Files
services/ping/proto/ping.pb.go
Asim Aslam 420f0706b0 add a ping service (#372)
* add a ping service

* add examples and public api file

* add minecraft server ping
2022-02-14 15:05:28 +00:00

531 lines
15 KiB
Go

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.15.6
// source: proto/ping.proto
package ping
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Ping an IP address
type IpRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// address to ping
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
}
func (x *IpRequest) Reset() {
*x = IpRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_ping_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *IpRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IpRequest) ProtoMessage() {}
func (x *IpRequest) ProtoReflect() protoreflect.Message {
mi := &file_proto_ping_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use IpRequest.ProtoReflect.Descriptor instead.
func (*IpRequest) Descriptor() ([]byte, []int) {
return file_proto_ping_proto_rawDescGZIP(), []int{0}
}
func (x *IpRequest) GetAddress() string {
if x != nil {
return x.Address
}
return ""
}
type IpResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// response status
Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
// average latency e.g 10ms
Latency string `protobuf:"bytes,2,opt,name=latency,proto3" json:"latency,omitempty"`
}
func (x *IpResponse) Reset() {
*x = IpResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_ping_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *IpResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IpResponse) ProtoMessage() {}
func (x *IpResponse) ProtoReflect() protoreflect.Message {
mi := &file_proto_ping_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use IpResponse.ProtoReflect.Descriptor instead.
func (*IpResponse) Descriptor() ([]byte, []int) {
return file_proto_ping_proto_rawDescGZIP(), []int{1}
}
func (x *IpResponse) GetStatus() string {
if x != nil {
return x.Status
}
return ""
}
func (x *IpResponse) GetLatency() string {
if x != nil {
return x.Latency
}
return ""
}
// Ping a HTTP URL
type UrlRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// address to use
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
// method of the call
Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"`
}
func (x *UrlRequest) Reset() {
*x = UrlRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_ping_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UrlRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UrlRequest) ProtoMessage() {}
func (x *UrlRequest) ProtoReflect() protoreflect.Message {
mi := &file_proto_ping_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UrlRequest.ProtoReflect.Descriptor instead.
func (*UrlRequest) Descriptor() ([]byte, []int) {
return file_proto_ping_proto_rawDescGZIP(), []int{2}
}
func (x *UrlRequest) GetAddress() string {
if x != nil {
return x.Address
}
return ""
}
func (x *UrlRequest) GetMethod() string {
if x != nil {
return x.Method
}
return ""
}
type UrlResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// the response status
Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
// the response code
Code int32 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"`
}
func (x *UrlResponse) Reset() {
*x = UrlResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_ping_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UrlResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UrlResponse) ProtoMessage() {}
func (x *UrlResponse) ProtoReflect() protoreflect.Message {
mi := &file_proto_ping_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UrlResponse.ProtoReflect.Descriptor instead.
func (*UrlResponse) Descriptor() ([]byte, []int) {
return file_proto_ping_proto_rawDescGZIP(), []int{3}
}
func (x *UrlResponse) GetStatus() string {
if x != nil {
return x.Status
}
return ""
}
func (x *UrlResponse) GetCode() int32 {
if x != nil {
return x.Code
}
return 0
}
// Ping a TCP port is open
type TcpRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// address to dial
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
// optional data to send
Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
}
func (x *TcpRequest) Reset() {
*x = TcpRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_ping_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TcpRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TcpRequest) ProtoMessage() {}
func (x *TcpRequest) ProtoReflect() protoreflect.Message {
mi := &file_proto_ping_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TcpRequest.ProtoReflect.Descriptor instead.
func (*TcpRequest) Descriptor() ([]byte, []int) {
return file_proto_ping_proto_rawDescGZIP(), []int{4}
}
func (x *TcpRequest) GetAddress() string {
if x != nil {
return x.Address
}
return ""
}
func (x *TcpRequest) GetData() string {
if x != nil {
return x.Data
}
return ""
}
type TcpResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// response status
Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
// response data if any
Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
}
func (x *TcpResponse) Reset() {
*x = TcpResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_ping_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TcpResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TcpResponse) ProtoMessage() {}
func (x *TcpResponse) ProtoReflect() protoreflect.Message {
mi := &file_proto_ping_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TcpResponse.ProtoReflect.Descriptor instead.
func (*TcpResponse) Descriptor() ([]byte, []int) {
return file_proto_ping_proto_rawDescGZIP(), []int{5}
}
func (x *TcpResponse) GetStatus() string {
if x != nil {
return x.Status
}
return ""
}
func (x *TcpResponse) GetData() string {
if x != nil {
return x.Data
}
return ""
}
var File_proto_ping_proto protoreflect.FileDescriptor
var file_proto_ping_proto_rawDesc = []byte{
0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x22, 0x25, 0x0a, 0x09, 0x49, 0x70, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22,
0x3e, 0x0a, 0x0a, 0x49, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a,
0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73,
0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x22,
0x3e, 0x0a, 0x0a, 0x55, 0x72, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a,
0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f,
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x22,
0x39, 0x0a, 0x0b, 0x55, 0x72, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16,
0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x3a, 0x0a, 0x0a, 0x54, 0x63,
0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72,
0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65,
0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x39, 0x0a, 0x0b, 0x54, 0x63, 0x70, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a,
0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74,
0x61, 0x32, 0x8d, 0x01, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x29, 0x0a, 0x02, 0x49, 0x70,
0x12, 0x0f, 0x2e, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x49, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x10, 0x2e, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x49, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2c, 0x0a, 0x03, 0x55, 0x72, 0x6c, 0x12, 0x10, 0x2e, 0x70,
0x69, 0x6e, 0x67, 0x2e, 0x55, 0x72, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11,
0x2e, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x55, 0x72, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x22, 0x00, 0x12, 0x2c, 0x0a, 0x03, 0x54, 0x63, 0x70, 0x12, 0x10, 0x2e, 0x70, 0x69, 0x6e,
0x67, 0x2e, 0x54, 0x63, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x70,
0x69, 0x6e, 0x67, 0x2e, 0x54, 0x63, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
0x00, 0x42, 0x0e, 0x5a, 0x0c, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x70, 0x69, 0x6e,
0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_proto_ping_proto_rawDescOnce sync.Once
file_proto_ping_proto_rawDescData = file_proto_ping_proto_rawDesc
)
func file_proto_ping_proto_rawDescGZIP() []byte {
file_proto_ping_proto_rawDescOnce.Do(func() {
file_proto_ping_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_ping_proto_rawDescData)
})
return file_proto_ping_proto_rawDescData
}
var file_proto_ping_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_proto_ping_proto_goTypes = []interface{}{
(*IpRequest)(nil), // 0: ping.IpRequest
(*IpResponse)(nil), // 1: ping.IpResponse
(*UrlRequest)(nil), // 2: ping.UrlRequest
(*UrlResponse)(nil), // 3: ping.UrlResponse
(*TcpRequest)(nil), // 4: ping.TcpRequest
(*TcpResponse)(nil), // 5: ping.TcpResponse
}
var file_proto_ping_proto_depIdxs = []int32{
0, // 0: ping.Ping.Ip:input_type -> ping.IpRequest
2, // 1: ping.Ping.Url:input_type -> ping.UrlRequest
4, // 2: ping.Ping.Tcp:input_type -> ping.TcpRequest
1, // 3: ping.Ping.Ip:output_type -> ping.IpResponse
3, // 4: ping.Ping.Url:output_type -> ping.UrlResponse
5, // 5: ping.Ping.Tcp:output_type -> ping.TcpResponse
3, // [3:6] is the sub-list for method output_type
0, // [0:3] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_proto_ping_proto_init() }
func file_proto_ping_proto_init() {
if File_proto_ping_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_proto_ping_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*IpRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_ping_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*IpResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_ping_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UrlRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_ping_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UrlResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_ping_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TcpRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_proto_ping_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TcpResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_proto_ping_proto_rawDesc,
NumEnums: 0,
NumMessages: 6,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_proto_ping_proto_goTypes,
DependencyIndexes: file_proto_ping_proto_depIdxs,
MessageInfos: file_proto_ping_proto_msgTypes,
}.Build()
File_proto_ping_proto = out.File
file_proto_ping_proto_rawDesc = nil
file_proto_ping_proto_goTypes = nil
file_proto_ping_proto_depIdxs = nil
}