pb

package
v0.0.0-...-97b9ebb Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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)

View Source
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.

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) Descriptor() ([]byte, []int)

Deprecated: Use NodeCoord.ProtoReflect.Descriptor instead.

func (*NodeCoord) GetAddress

func (x *NodeCoord) GetAddress() string

func (*NodeCoord) GetLocator

func (x *NodeCoord) GetLocator() []byte

func (*NodeCoord) ProtoMessage

func (*NodeCoord) ProtoMessage()

func (*NodeCoord) ProtoReflect

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

func (*NodeCoord) Reset

func (x *NodeCoord) Reset()

func (*NodeCoord) String

func (x *NodeCoord) String() string

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

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.

Jump to

Keyboard shortcuts

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