proto

package
v0.0.0-...-f163260 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DataType_name = map[int32]string{
		0:     "UNKNOWN",
		1:     "AUTH",
		2:     "BLOCKCHAIN_MISC_ASSET",
		3:     "TRANSACTION",
		4:     "WALLET",
		5:     "BLOCK",
		6:     "CONTRACT",
		7:     "DNS",
		8:     "ERROR",
		9:     "INFO",
		10:    "META",
		11:    "NFT",
		12:    "CONTENT",
		13:    "STATE",
		14:    "INDEX",
		15:    "RECEIPT",
		16:    "HEADER",
		17:    "REDIRECT",
		18:    "PLUGIN",
		19:    "ADDRESS",
		20:    "KEY",
		21:    "ROUTER",
		22:    "PROXY",
		23:    "QUANTIX",
		24:    "VERSION",
		25:    "FILE",
		26:    "ORACLE",
		27:    "GENESIS",
		28:    "BRIDGE",
		29:    "CHILD_CHAIN_LAYERX",
		998:   "COMMAND",
		999:   "INTERNAL",
		99887: "EGG",
	}
	DataType_value = map[string]int32{
		"UNKNOWN":               0,
		"AUTH":                  1,
		"BLOCKCHAIN_MISC_ASSET": 2,
		"TRANSACTION":           3,
		"WALLET":                4,
		"BLOCK":                 5,
		"CONTRACT":              6,
		"DNS":                   7,
		"ERROR":                 8,
		"INFO":                  9,
		"META":                  10,
		"NFT":                   11,
		"CONTENT":               12,
		"STATE":                 13,
		"INDEX":                 14,
		"RECEIPT":               15,
		"HEADER":                16,
		"REDIRECT":              17,
		"PLUGIN":                18,
		"ADDRESS":               19,
		"KEY":                   20,
		"ROUTER":                21,
		"PROXY":                 22,
		"QUANTIX":               23,
		"VERSION":               24,
		"FILE":                  25,
		"ORACLE":                26,
		"GENESIS":               27,
		"BRIDGE":                28,
		"CHILD_CHAIN_LAYERX":    29,
		"COMMAND":               998,
		"INTERNAL":              999,
		"EGG":                   99887,
	}
)

Enum value maps for DataType.

View Source
var Discovery_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "v1.Discovery",
	HandlerType: (*DiscoveryServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "FindPeers",
			Handler:    _Discovery_FindPeers_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "p2p/proto/discovery.proto",
}

Discovery_ServiceDesc is the grpc.ServiceDesc for Discovery service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_p2p_proto_discovery_proto protoreflect.FileDescriptor
View Source
var File_p2p_proto_identityprotocol_proto protoreflect.FileDescriptor
View Source
var File_p2p_proto_messages_proto protoreflect.FileDescriptor
View Source
var Identity_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "v1.Identity",
	HandlerType: (*IdentityServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Handshake",
			Handler:    _Identity_Handshake_Handler,
		},
		{
			MethodName: "Bye",
			Handler:    _Identity_Bye_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "p2p/proto/identityprotocol.proto",
}

Identity_ServiceDesc is the grpc.ServiceDesc for Identity service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterDiscoveryServer

func RegisterDiscoveryServer(s grpc.ServiceRegistrar, srv DiscoveryServer)

func RegisterIdentityServer

func RegisterIdentityServer(s grpc.ServiceRegistrar, srv IdentityServer)

Types

type ApiRequest

type ApiRequest struct {
	AuthToken string `protobuf:"bytes,1,opt,name=authToken,proto3" json:"authToken,omitempty"`
	ReqID     string `protobuf:"bytes,2,opt,name=ReqID,proto3" json:"ReqID,omitempty"`
	ApiPath   string `protobuf:"bytes,3,opt,name=ApiPath,proto3" json:"ApiPath,omitempty"`
	ReqData   []byte `protobuf:"bytes,4,opt,name=ReqData,proto3" json:"ReqData,omitempty"`
	// contains filtered or unexported fields
}

func (*ApiRequest) Descriptor deprecated

func (*ApiRequest) Descriptor() ([]byte, []int)

Deprecated: Use ApiRequest.ProtoReflect.Descriptor instead.

func (*ApiRequest) GetApiPath

func (x *ApiRequest) GetApiPath() string

func (*ApiRequest) GetAuthToken

func (x *ApiRequest) GetAuthToken() string

func (*ApiRequest) GetReqData

func (x *ApiRequest) GetReqData() []byte

func (*ApiRequest) GetReqID

func (x *ApiRequest) GetReqID() string

func (*ApiRequest) ProtoMessage

func (*ApiRequest) ProtoMessage()

func (*ApiRequest) ProtoReflect

func (x *ApiRequest) ProtoReflect() protoreflect.Message

func (*ApiRequest) Reset

func (x *ApiRequest) Reset()

func (*ApiRequest) String

func (x *ApiRequest) String() string

type ApiResponse

type ApiResponse struct {
	ReqID       string   `protobuf:"bytes,1,opt,name=ReqID,proto3" json:"ReqID,omitempty"`
	ResID       string   `protobuf:"bytes,2,opt,name=ResID,proto3" json:"ResID,omitempty"`
	ResData     []byte   `protobuf:"bytes,3,opt,name=ResData,proto3" json:"ResData,omitempty"`
	ResDataType DataType `protobuf:"varint,4,opt,name=ResDataType,proto3,enum=v1.DataType" json:"ResDataType,omitempty"`
	StatusCode  int32    `protobuf:"varint,5,opt,name=StatusCode,proto3" json:"StatusCode,omitempty"`
	// contains filtered or unexported fields
}

func (*ApiResponse) Descriptor deprecated

func (*ApiResponse) Descriptor() ([]byte, []int)

Deprecated: Use ApiResponse.ProtoReflect.Descriptor instead.

func (*ApiResponse) GetReqID

func (x *ApiResponse) GetReqID() string

func (*ApiResponse) GetResData

func (x *ApiResponse) GetResData() []byte

func (*ApiResponse) GetResDataType

func (x *ApiResponse) GetResDataType() DataType

func (*ApiResponse) GetResID

func (x *ApiResponse) GetResID() string

func (*ApiResponse) GetStatusCode

func (x *ApiResponse) GetStatusCode() int32

func (*ApiResponse) ProtoMessage

func (*ApiResponse) ProtoMessage()

func (*ApiResponse) ProtoReflect

func (x *ApiResponse) ProtoReflect() protoreflect.Message

func (*ApiResponse) Reset

func (x *ApiResponse) Reset()

func (*ApiResponse) String

func (x *ApiResponse) String() string

type ByeMsg

type ByeMsg struct {
	Reason string `protobuf:"bytes,1,opt,name=reason,proto3" json:"reason,omitempty"`
	// contains filtered or unexported fields
}

func (*ByeMsg) Descriptor deprecated

func (*ByeMsg) Descriptor() ([]byte, []int)

Deprecated: Use ByeMsg.ProtoReflect.Descriptor instead.

func (*ByeMsg) GetReason

func (x *ByeMsg) GetReason() string

func (*ByeMsg) ProtoMessage

func (*ByeMsg) ProtoMessage()

func (*ByeMsg) ProtoReflect

func (x *ByeMsg) ProtoReflect() protoreflect.Message

func (*ByeMsg) Reset

func (x *ByeMsg) Reset()

func (*ByeMsg) String

func (x *ByeMsg) String() string

type DataType

type DataType int32
const (
	DataType_UNKNOWN               DataType = 0
	DataType_AUTH                  DataType = 1
	DataType_BLOCKCHAIN_MISC_ASSET DataType = 2
	DataType_TRANSACTION           DataType = 3
	DataType_WALLET                DataType = 4
	DataType_BLOCK                 DataType = 5
	DataType_CONTRACT              DataType = 6
	DataType_DNS                   DataType = 7
	DataType_ERROR                 DataType = 8
	DataType_INFO                  DataType = 9
	DataType_META                  DataType = 10
	DataType_NFT                   DataType = 11
	DataType_CONTENT               DataType = 12
	DataType_STATE                 DataType = 13
	DataType_INDEX                 DataType = 14
	DataType_RECEIPT               DataType = 15
	DataType_HEADER                DataType = 16
	DataType_REDIRECT              DataType = 17
	DataType_PLUGIN                DataType = 18
	DataType_ADDRESS               DataType = 19
	DataType_KEY                   DataType = 20
	DataType_ROUTER                DataType = 21
	DataType_PROXY                 DataType = 22
	DataType_QUANTIX               DataType = 23
	DataType_VERSION               DataType = 24
	DataType_FILE                  DataType = 25
	DataType_ORACLE                DataType = 26
	DataType_GENESIS               DataType = 27
	DataType_BRIDGE                DataType = 28
	DataType_CHILD_CHAIN_LAYERX    DataType = 29
	DataType_COMMAND               DataType = 998
	DataType_INTERNAL              DataType = 999
	DataType_EGG                   DataType = 99887
)

func (DataType) Descriptor

func (DataType) Descriptor() protoreflect.EnumDescriptor

func (DataType) Enum

func (x DataType) Enum() *DataType

func (DataType) EnumDescriptor deprecated

func (DataType) EnumDescriptor() ([]byte, []int)

Deprecated: Use DataType.Descriptor instead.

func (DataType) Number

func (x DataType) Number() protoreflect.EnumNumber

func (DataType) String

func (x DataType) String() string

func (DataType) Type

type DiscoveryClient

type DiscoveryClient interface {
	FindPeers(ctx context.Context, in *FindPeersReq, opts ...grpc.CallOption) (*FindPeersResp, error)
}

DiscoveryClient is the client API for Discovery service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewDiscoveryClient

func NewDiscoveryClient(cc grpc.ClientConnInterface) DiscoveryClient

type DiscoveryServer

type DiscoveryServer interface {
	FindPeers(context.Context, *FindPeersReq) (*FindPeersResp, error)
	// contains filtered or unexported methods
}

DiscoveryServer is the server API for Discovery service. All implementations must embed UnimplementedDiscoveryServer for forward compatibility

type Error

type Error struct {
	ReqID   string `protobuf:"bytes,1,opt,name=ReqID,proto3" json:"ReqID,omitempty"`
	Code    int32  `protobuf:"varint,2,opt,name=Code,proto3" json:"Code,omitempty"`
	Message string `protobuf:"bytes,3,opt,name=Message,proto3" json:"Message,omitempty"`
	// contains filtered or unexported fields
}

func (*Error) Descriptor deprecated

func (*Error) Descriptor() ([]byte, []int)

Deprecated: Use Error.ProtoReflect.Descriptor instead.

func (*Error) GetCode

func (x *Error) GetCode() int32

func (*Error) GetMessage

func (x *Error) GetMessage() string

func (*Error) GetReqID

func (x *Error) GetReqID() string

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) ProtoReflect

func (x *Error) ProtoReflect() protoreflect.Message

func (*Error) Reset

func (x *Error) Reset()

func (*Error) String

func (x *Error) String() string

type FindPeersReq

type FindPeersReq struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Count int64  `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
	// contains filtered or unexported fields
}

func (*FindPeersReq) Descriptor deprecated

func (*FindPeersReq) Descriptor() ([]byte, []int)

Deprecated: Use FindPeersReq.ProtoReflect.Descriptor instead.

func (*FindPeersReq) GetCount

func (x *FindPeersReq) GetCount() int64

func (*FindPeersReq) GetKey

func (x *FindPeersReq) GetKey() string

func (*FindPeersReq) ProtoMessage

func (*FindPeersReq) ProtoMessage()

func (*FindPeersReq) ProtoReflect

func (x *FindPeersReq) ProtoReflect() protoreflect.Message

func (*FindPeersReq) Reset

func (x *FindPeersReq) Reset()

func (*FindPeersReq) String

func (x *FindPeersReq) String() string

type FindPeersResp

type FindPeersResp struct {
	Nodes []string `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"`
	// contains filtered or unexported fields
}

func (*FindPeersResp) Descriptor deprecated

func (*FindPeersResp) Descriptor() ([]byte, []int)

Deprecated: Use FindPeersResp.ProtoReflect.Descriptor instead.

func (*FindPeersResp) GetNodes

func (x *FindPeersResp) GetNodes() []string

func (*FindPeersResp) ProtoMessage

func (*FindPeersResp) ProtoMessage()

func (*FindPeersResp) ProtoReflect

func (x *FindPeersResp) ProtoReflect() protoreflect.Message

func (*FindPeersResp) Reset

func (x *FindPeersResp) Reset()

func (*FindPeersResp) String

func (x *FindPeersResp) String() string

type IdentityClient

type IdentityClient interface {
	Handshake(ctx context.Context, in *Status, opts ...grpc.CallOption) (*Status, error)
	Bye(ctx context.Context, in *ByeMsg, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

IdentityClient is the client API for Identity service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewIdentityClient

func NewIdentityClient(cc grpc.ClientConnInterface) IdentityClient

type IdentityServer

type IdentityServer interface {
	Handshake(context.Context, *Status) (*Status, error)
	Bye(context.Context, *ByeMsg) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

IdentityServer is the server API for Identity service. All implementations must embed UnimplementedIdentityServer for forward compatibility

type Status

type Status struct {
	Metadata map[string]string `` /* 157-byte string literal not displayed */
	Keys     []*Status_Key     `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"`
	Chain    int64             `protobuf:"varint,3,opt,name=chain,proto3" json:"chain,omitempty"`
	Genesis  string            `protobuf:"bytes,4,opt,name=genesis,proto3" json:"genesis,omitempty"`
	// contains filtered or unexported fields
}

func (*Status) Descriptor deprecated

func (*Status) Descriptor() ([]byte, []int)

Deprecated: Use Status.ProtoReflect.Descriptor instead.

func (*Status) GetChain

func (x *Status) GetChain() int64

func (*Status) GetGenesis

func (x *Status) GetGenesis() string

func (*Status) GetKeys

func (x *Status) GetKeys() []*Status_Key

func (*Status) GetMetadata

func (x *Status) GetMetadata() map[string]string

func (*Status) ProtoMessage

func (*Status) ProtoMessage()

func (*Status) ProtoReflect

func (x *Status) ProtoReflect() protoreflect.Message

func (*Status) Reset

func (x *Status) Reset()

func (*Status) String

func (x *Status) String() string

type Status_Key

type Status_Key struct {
	Signature string `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"`
	Message   string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*Status_Key) Descriptor deprecated

func (*Status_Key) Descriptor() ([]byte, []int)

Deprecated: Use Status_Key.ProtoReflect.Descriptor instead.

func (*Status_Key) GetMessage

func (x *Status_Key) GetMessage() string

func (*Status_Key) GetSignature

func (x *Status_Key) GetSignature() string

func (*Status_Key) ProtoMessage

func (*Status_Key) ProtoMessage()

func (*Status_Key) ProtoReflect

func (x *Status_Key) ProtoReflect() protoreflect.Message

func (*Status_Key) Reset

func (x *Status_Key) Reset()

func (*Status_Key) String

func (x *Status_Key) String() string

type UnimplementedDiscoveryServer

type UnimplementedDiscoveryServer struct {
}

UnimplementedDiscoveryServer must be embedded to have forward compatible implementations.

func (UnimplementedDiscoveryServer) FindPeers

type UnimplementedIdentityServer

type UnimplementedIdentityServer struct {
}

UnimplementedIdentityServer must be embedded to have forward compatible implementations.

func (UnimplementedIdentityServer) Bye

func (UnimplementedIdentityServer) Handshake

type UnsafeDiscoveryServer

type UnsafeDiscoveryServer interface {
	// contains filtered or unexported methods
}

UnsafeDiscoveryServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DiscoveryServer will result in compilation errors.

type UnsafeIdentityServer

type UnsafeIdentityServer interface {
	// contains filtered or unexported methods
}

UnsafeIdentityServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to IdentityServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL