Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DiscoveryService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "degitx.discovery.DiscoveryService", HandlerType: (*DiscoveryServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Ping", Handler: _DiscoveryService_Ping_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "discovery.proto", }
DiscoveryService_ServiceDesc is the grpc.ServiceDesc for DiscoveryService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_discovery_proto protoreflect.FileDescriptor
Functions ¶
func RegisterDiscoveryServiceServer ¶
func RegisterDiscoveryServiceServer(s grpc.ServiceRegistrar, srv DiscoveryServiceServer)
Types ¶
type DiscoveryServiceClient ¶
type DiscoveryServiceClient interface { // Ping - send ping request to discovery service to propagate self coordinates // and receive known peers of service. Ping(ctx context.Context, in *NodeCoord, opts ...grpc.CallOption) (*PingResponse, error) }
DiscoveryServiceClient is the client API for DiscoveryService 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 NewDiscoveryServiceClient ¶
func NewDiscoveryServiceClient(cc grpc.ClientConnInterface) DiscoveryServiceClient
type DiscoveryServiceServer ¶
type DiscoveryServiceServer interface { // Ping - send ping request to discovery service to propagate self coordinates // and receive known peers of service. Ping(context.Context, *NodeCoord) (*PingResponse, error) // contains filtered or unexported methods }
DiscoveryServiceServer is the server API for DiscoveryService service. All implementations must embed UnimplementedDiscoveryServiceServer for forward compatibility
type NodeCoord ¶
type NodeCoord struct { // locator - node ID multihash Locator []byte `protobuf:"bytes,1,opt,name=locator,proto3" json:"locator,omitempty"` // address - multiaddr of node Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // contains filtered or unexported fields }
NodeCoord - coordinate of node
func (*NodeCoord) Descriptor
deprecated
func (*NodeCoord) GetAddress ¶
func (*NodeCoord) GetLocator ¶
func (*NodeCoord) ProtoMessage ¶
func (*NodeCoord) ProtoMessage()
func (*NodeCoord) ProtoReflect ¶
func (x *NodeCoord) ProtoReflect() protoreflect.Message
type PingRequest ¶
type PingRequest struct { // locator - node coordinates of self Locator *NodeCoord `protobuf:"bytes,1,opt,name=locator,proto3" json:"locator,omitempty"` // contains filtered or unexported fields }
PingRequest - sends by node periodically to seed node
func (*PingRequest) Descriptor
deprecated
func (*PingRequest) Descriptor() ([]byte, []int)
Deprecated: Use PingRequest.ProtoReflect.Descriptor instead.
func (*PingRequest) GetLocator ¶
func (x *PingRequest) GetLocator() *NodeCoord
func (*PingRequest) ProtoMessage ¶
func (*PingRequest) ProtoMessage()
func (*PingRequest) ProtoReflect ¶
func (x *PingRequest) ProtoReflect() protoreflect.Message
func (*PingRequest) Reset ¶
func (x *PingRequest) Reset()
func (*PingRequest) String ¶
func (x *PingRequest) String() string
type PingResponse ¶
type PingResponse struct { // peers - known peers Peers []*NodeCoord `protobuf:"bytes,1,rep,name=peers,proto3" json:"peers,omitempty"` // contains filtered or unexported fields }
PingResponse - returned on ping request
func (*PingResponse) Descriptor
deprecated
func (*PingResponse) Descriptor() ([]byte, []int)
Deprecated: Use PingResponse.ProtoReflect.Descriptor instead.
func (*PingResponse) GetPeers ¶
func (x *PingResponse) GetPeers() []*NodeCoord
func (*PingResponse) ProtoMessage ¶
func (*PingResponse) ProtoMessage()
func (*PingResponse) ProtoReflect ¶
func (x *PingResponse) ProtoReflect() protoreflect.Message
func (*PingResponse) Reset ¶
func (x *PingResponse) Reset()
func (*PingResponse) String ¶
func (x *PingResponse) String() string
type UnimplementedDiscoveryServiceServer ¶
type UnimplementedDiscoveryServiceServer struct { }
UnimplementedDiscoveryServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedDiscoveryServiceServer) Ping ¶
func (UnimplementedDiscoveryServiceServer) Ping(context.Context, *NodeCoord) (*PingResponse, error)
type UnsafeDiscoveryServiceServer ¶
type UnsafeDiscoveryServiceServer interface {
// contains filtered or unexported methods
}
UnsafeDiscoveryServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DiscoveryServiceServer will result in compilation errors.