messaging

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Status_name = map[int32]string{
		0: "OK",
		1: "Failed",
		2: "Unknown",
	}
	Status_value = map[string]int32{
		"OK":      0,
		"Failed":  1,
		"Unknown": 2,
	}
)

Enum value maps for Status.

View Source
var File_messaging_kademlia_proto protoreflect.FileDescriptor
View Source
var KademliaMessenger_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "messaging.KademliaMessenger",
	HandlerType: (*KademliaMessengerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Ping",
			Handler:    _KademliaMessenger_Ping_Handler,
		},
		{
			MethodName: "FindNodes",
			Handler:    _KademliaMessenger_FindNodes_Handler,
		},
		{
			MethodName: "Provide",
			Handler:    _KademliaMessenger_Provide_Handler,
		},
		{
			MethodName: "FindProvider",
			Handler:    _KademliaMessenger_FindProvider_Handler,
		},
		{
			MethodName: "Put",
			Handler:    _KademliaMessenger_Put_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _KademliaMessenger_Get_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "messaging/kademlia.proto",
}

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

Functions

func RegisterKademliaMessengerServer

func RegisterKademliaMessengerServer(s grpc.ServiceRegistrar, srv KademliaMessengerServer)

Types

type FindNodesRequest

type FindNodesRequest struct {
	TargetId []byte `protobuf:"bytes,1,opt,name=targetId,proto3" json:"targetId,omitempty"`
	K        int32  `protobuf:"varint,2,opt,name=k,proto3" json:"k,omitempty"`
	Self     string `protobuf:"bytes,3,opt,name=self,proto3" json:"self,omitempty"`
	// contains filtered or unexported fields
}

func (*FindNodesRequest) Descriptor deprecated

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

Deprecated: Use FindNodesRequest.ProtoReflect.Descriptor instead.

func (*FindNodesRequest) GetK

func (x *FindNodesRequest) GetK() int32

func (*FindNodesRequest) GetSelf

func (x *FindNodesRequest) GetSelf() string

func (*FindNodesRequest) GetTargetId

func (x *FindNodesRequest) GetTargetId() []byte

func (*FindNodesRequest) ProtoMessage

func (*FindNodesRequest) ProtoMessage()

func (*FindNodesRequest) ProtoReflect

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

func (*FindNodesRequest) Reset

func (x *FindNodesRequest) Reset()

func (*FindNodesRequest) String

func (x *FindNodesRequest) String() string

type FindNodesResponse

type FindNodesResponse struct {
	Status Status   `protobuf:"varint,1,opt,name=status,proto3,enum=messaging.Status" json:"status,omitempty"`
	Nodes  []string `protobuf:"bytes,2,rep,name=nodes,proto3" json:"nodes,omitempty"`
	// contains filtered or unexported fields
}

func (*FindNodesResponse) Descriptor deprecated

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

Deprecated: Use FindNodesResponse.ProtoReflect.Descriptor instead.

func (*FindNodesResponse) GetNodes

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

func (*FindNodesResponse) GetStatus

func (x *FindNodesResponse) GetStatus() Status

func (*FindNodesResponse) ProtoMessage

func (*FindNodesResponse) ProtoMessage()

func (*FindNodesResponse) ProtoReflect

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

func (*FindNodesResponse) Reset

func (x *FindNodesResponse) Reset()

func (*FindNodesResponse) String

func (x *FindNodesResponse) String() string

type FindProvidersRequest

type FindProvidersRequest struct {
	Key  []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Self string `protobuf:"bytes,2,opt,name=self,proto3" json:"self,omitempty"`
	// contains filtered or unexported fields
}

func (*FindProvidersRequest) Descriptor deprecated

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

Deprecated: Use FindProvidersRequest.ProtoReflect.Descriptor instead.

func (*FindProvidersRequest) GetKey

func (x *FindProvidersRequest) GetKey() []byte

func (*FindProvidersRequest) GetSelf

func (x *FindProvidersRequest) GetSelf() string

func (*FindProvidersRequest) ProtoMessage

func (*FindProvidersRequest) ProtoMessage()

func (*FindProvidersRequest) ProtoReflect

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

func (*FindProvidersRequest) Reset

func (x *FindProvidersRequest) Reset()

func (*FindProvidersRequest) String

func (x *FindProvidersRequest) String() string

type FindProvidersResponse

type FindProvidersResponse struct {
	Status          Status   `protobuf:"varint,1,opt,name=status,proto3,enum=messaging.Status" json:"status,omitempty"`
	Nodes           []string `protobuf:"bytes,2,rep,name=nodes,proto3" json:"nodes,omitempty"`
	ClosestToTarget []string `protobuf:"bytes,3,rep,name=closestToTarget,proto3" json:"closestToTarget,omitempty"`
	// contains filtered or unexported fields
}

func (*FindProvidersResponse) Descriptor deprecated

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

Deprecated: Use FindProvidersResponse.ProtoReflect.Descriptor instead.

func (*FindProvidersResponse) GetClosestToTarget

func (x *FindProvidersResponse) GetClosestToTarget() []string

func (*FindProvidersResponse) GetNodes

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

func (*FindProvidersResponse) GetStatus

func (x *FindProvidersResponse) GetStatus() Status

func (*FindProvidersResponse) ProtoMessage

func (*FindProvidersResponse) ProtoMessage()

func (*FindProvidersResponse) ProtoReflect

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

func (*FindProvidersResponse) Reset

func (x *FindProvidersResponse) Reset()

func (*FindProvidersResponse) String

func (x *FindProvidersResponse) String() string

type GetRequest

type GetRequest struct {
	Key  []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Self string `protobuf:"bytes,3,opt,name=self,proto3" json:"self,omitempty"`
	// contains filtered or unexported fields
}

func (*GetRequest) Descriptor deprecated

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

Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.

func (*GetRequest) GetKey

func (x *GetRequest) GetKey() []byte

func (*GetRequest) GetSelf

func (x *GetRequest) GetSelf() string

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) ProtoReflect

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

func (*GetRequest) Reset

func (x *GetRequest) Reset()

func (*GetRequest) String

func (x *GetRequest) String() string

type GetResponse

type GetResponse struct {
	Status          Status   `protobuf:"varint,1,opt,name=status,proto3,enum=messaging.Status" json:"status,omitempty"`
	Value           []byte   `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	ClosestToTarget []string `protobuf:"bytes,3,rep,name=closestToTarget,proto3" json:"closestToTarget,omitempty"`
	// contains filtered or unexported fields
}

func (*GetResponse) Descriptor deprecated

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

Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.

func (*GetResponse) GetClosestToTarget

func (x *GetResponse) GetClosestToTarget() []string

func (*GetResponse) GetStatus

func (x *GetResponse) GetStatus() Status

func (*GetResponse) GetValue

func (x *GetResponse) GetValue() []byte

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) ProtoReflect

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

func (*GetResponse) Reset

func (x *GetResponse) Reset()

func (*GetResponse) String

func (x *GetResponse) String() string

type KademliaMessengerClient

type KademliaMessengerClient interface {
	// Pings a particular node to see if its up.
	Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
	// Find Nodes at Distance
	FindNodes(ctx context.Context, in *FindNodesRequest, opts ...grpc.CallOption) (*FindNodesResponse, error)
	// Provide RPC, Instruct nodes to add the provider record.
	Provide(ctx context.Context, in *ProvideRequest, opts ...grpc.CallOption) (*ProvideResponse, error)
	// FindProvider, Get the provider records from the Provider Store
	FindProvider(ctx context.Context, in *FindProvidersRequest, opts ...grpc.CallOption) (*FindProvidersResponse, error)
	// Put RPC
	Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error)
	// Get RPC
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
}

KademliaMessengerClient is the client API for KademliaMessenger 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 KademliaMessengerServer

type KademliaMessengerServer interface {
	// Pings a particular node to see if its up.
	Ping(context.Context, *PingRequest) (*PingResponse, error)
	// Find Nodes at Distance
	FindNodes(context.Context, *FindNodesRequest) (*FindNodesResponse, error)
	// Provide RPC, Instruct nodes to add the provider record.
	Provide(context.Context, *ProvideRequest) (*ProvideResponse, error)
	// FindProvider, Get the provider records from the Provider Store
	FindProvider(context.Context, *FindProvidersRequest) (*FindProvidersResponse, error)
	// Put RPC
	Put(context.Context, *PutRequest) (*PutResponse, error)
	// Get RPC
	Get(context.Context, *GetRequest) (*GetResponse, error)
	// contains filtered or unexported methods
}

KademliaMessengerServer is the server API for KademliaMessenger service. All implementations must embed UnimplementedKademliaMessengerServer for forward compatibility

type PingRequest

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

func (*PingRequest) Descriptor deprecated

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

Deprecated: Use PingRequest.ProtoReflect.Descriptor instead.

func (*PingRequest) GetMessage

func (x *PingRequest) GetMessage() string

func (*PingRequest) GetSelf

func (x *PingRequest) GetSelf() string

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 {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	Status  Status `protobuf:"varint,2,opt,name=status,proto3,enum=messaging.Status" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*PingResponse) Descriptor deprecated

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

Deprecated: Use PingResponse.ProtoReflect.Descriptor instead.

func (*PingResponse) GetMessage

func (x *PingResponse) GetMessage() string

func (*PingResponse) GetStatus

func (x *PingResponse) GetStatus() Status

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 ProvideRequest

type ProvideRequest struct {
	Key  []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Self string `protobuf:"bytes,2,opt,name=self,proto3" json:"self,omitempty"`
	// contains filtered or unexported fields
}

func (*ProvideRequest) Descriptor deprecated

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

Deprecated: Use ProvideRequest.ProtoReflect.Descriptor instead.

func (*ProvideRequest) GetKey

func (x *ProvideRequest) GetKey() []byte

func (*ProvideRequest) GetSelf

func (x *ProvideRequest) GetSelf() string

func (*ProvideRequest) ProtoMessage

func (*ProvideRequest) ProtoMessage()

func (*ProvideRequest) ProtoReflect

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

func (*ProvideRequest) Reset

func (x *ProvideRequest) Reset()

func (*ProvideRequest) String

func (x *ProvideRequest) String() string

type ProvideResponse

type ProvideResponse struct {
	Status Status `protobuf:"varint,1,opt,name=status,proto3,enum=messaging.Status" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*ProvideResponse) Descriptor deprecated

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

Deprecated: Use ProvideResponse.ProtoReflect.Descriptor instead.

func (*ProvideResponse) GetStatus

func (x *ProvideResponse) GetStatus() Status

func (*ProvideResponse) ProtoMessage

func (*ProvideResponse) ProtoMessage()

func (*ProvideResponse) ProtoReflect

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

func (*ProvideResponse) Reset

func (x *ProvideResponse) Reset()

func (*ProvideResponse) String

func (x *ProvideResponse) String() string

type PutRequest

type PutRequest struct {
	Key   []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	Self  string `protobuf:"bytes,3,opt,name=self,proto3" json:"self,omitempty"`
	// contains filtered or unexported fields
}

func (*PutRequest) Descriptor deprecated

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

Deprecated: Use PutRequest.ProtoReflect.Descriptor instead.

func (*PutRequest) GetKey

func (x *PutRequest) GetKey() []byte

func (*PutRequest) GetSelf

func (x *PutRequest) GetSelf() string

func (*PutRequest) GetValue

func (x *PutRequest) GetValue() []byte

func (*PutRequest) ProtoMessage

func (*PutRequest) ProtoMessage()

func (*PutRequest) ProtoReflect

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

func (*PutRequest) Reset

func (x *PutRequest) Reset()

func (*PutRequest) String

func (x *PutRequest) String() string

type PutResponse

type PutResponse struct {
	Status Status `protobuf:"varint,1,opt,name=status,proto3,enum=messaging.Status" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*PutResponse) Descriptor deprecated

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

Deprecated: Use PutResponse.ProtoReflect.Descriptor instead.

func (*PutResponse) GetStatus

func (x *PutResponse) GetStatus() Status

func (*PutResponse) ProtoMessage

func (*PutResponse) ProtoMessage()

func (*PutResponse) ProtoReflect

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

func (*PutResponse) Reset

func (x *PutResponse) Reset()

func (*PutResponse) String

func (x *PutResponse) String() string

type Status

type Status int32
const (
	Status_OK      Status = 0
	Status_Failed  Status = 1
	Status_Unknown Status = 2
)

func (Status) Descriptor

func (Status) Descriptor() protoreflect.EnumDescriptor

func (Status) Enum

func (x Status) Enum() *Status

func (Status) EnumDescriptor deprecated

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

Deprecated: Use Status.Descriptor instead.

func (Status) Number

func (x Status) Number() protoreflect.EnumNumber

func (Status) String

func (x Status) String() string

func (Status) Type

func (Status) Type() protoreflect.EnumType

type UnimplementedKademliaMessengerServer

type UnimplementedKademliaMessengerServer struct {
}

UnimplementedKademliaMessengerServer must be embedded to have forward compatible implementations.

func (UnimplementedKademliaMessengerServer) FindNodes

func (UnimplementedKademliaMessengerServer) FindProvider

func (UnimplementedKademliaMessengerServer) Get

func (UnimplementedKademliaMessengerServer) Ping

func (UnimplementedKademliaMessengerServer) Provide

func (UnimplementedKademliaMessengerServer) Put

type UnsafeKademliaMessengerServer

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

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

Jump to

Keyboard shortcuts

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