remote

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_remote_remote_proto protoreflect.FileDescriptor
View Source
var Remote_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "remote.Remote",
	HandlerType: (*RemoteServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "OnMessage",
			Handler:    _Remote_OnMessage_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "remote/remote.proto",
}

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

Functions

func Marshal

func Marshal(m proto.Message) (*anypb.Any, error)

func RegisterRemoteServer

func RegisterRemoteServer(s grpc.ServiceRegistrar, srv RemoteServer)

func Unmarshal

func Unmarshal(v *anypb.Any) (proto.Message, error)

Types

type Endpoint

type Endpoint struct {
	Name       string
	Addr       string
	Attributes *attributes.Attributes
	// contains filtered or unexported fields
}

func NewEndpoint

func NewEndpoint(nodeName string, addr string) (*Endpoint, error)

func (*Endpoint) Close

func (ep *Endpoint) Close() error

func (*Endpoint) SendMessage

func (ep *Endpoint) SendMessage(ctx context.Context, to core.PID, message core.Message) error

type Error

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

func (*Error) Descriptor deprecated

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

Deprecated: Use Error.ProtoReflect.Descriptor instead.

func (*Error) Error

func (e *Error) Error() string

func (*Error) GetCode

func (x *Error) GetCode() int32

func (*Error) GetDetail

func (x *Error) GetDetail() string

func (*Error) GetMsg

func (x *Error) GetMsg() 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 Message

type Message struct {
	From      *PID      `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"`
	RequestId int64     `protobuf:"varint,2,opt,name=requestId,proto3" json:"requestId,omitempty"`
	Data      *any1.Any `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	Flag      int32     `protobuf:"varint,4,opt,name=flag,proto3" json:"flag,omitempty"`
	// contains filtered or unexported fields
}

func (*Message) Descriptor deprecated

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetData

func (x *Message) GetData() *any1.Any

func (*Message) GetFlag

func (x *Message) GetFlag() int32

func (*Message) GetFrom

func (x *Message) GetFrom() *PID

func (*Message) GetRequestId

func (x *Message) GetRequestId() int64

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

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

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

type MessageCodec

type MessageCodec interface {
	Marshal(m proto.Message) (*anypb.Any, error)
	Unmarshal(v *anypb.Any) (proto.Message, error)
}

type OnMessageReply

type OnMessageReply struct {
	// contains filtered or unexported fields
}

func (*OnMessageReply) Descriptor deprecated

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

Deprecated: Use OnMessageReply.ProtoReflect.Descriptor instead.

func (*OnMessageReply) ProtoMessage

func (*OnMessageReply) ProtoMessage()

func (*OnMessageReply) ProtoReflect

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

func (*OnMessageReply) Reset

func (x *OnMessageReply) Reset()

func (*OnMessageReply) String

func (x *OnMessageReply) String() string

type OnMessageRequest

type OnMessageRequest struct {
	To      *PID     `protobuf:"bytes,1,opt,name=to,proto3" json:"to,omitempty"`
	Message *Message `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*OnMessageRequest) Descriptor deprecated

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

Deprecated: Use OnMessageRequest.ProtoReflect.Descriptor instead.

func (*OnMessageRequest) GetMessage

func (x *OnMessageRequest) GetMessage() *Message

func (*OnMessageRequest) GetTo

func (x *OnMessageRequest) GetTo() *PID

func (*OnMessageRequest) ProtoMessage

func (*OnMessageRequest) ProtoMessage()

func (*OnMessageRequest) ProtoReflect

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

func (*OnMessageRequest) Reset

func (x *OnMessageRequest) Reset()

func (*OnMessageRequest) String

func (x *OnMessageRequest) String() string

type PID

type PID struct {
	Node string `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
	Id   string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*PID) Descriptor deprecated

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

Deprecated: Use PID.ProtoReflect.Descriptor instead.

func (*PID) GetId

func (x *PID) GetId() string

func (*PID) GetNode

func (x *PID) GetNode() string

func (*PID) ProtoMessage

func (*PID) ProtoMessage()

func (*PID) ProtoReflect

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

func (*PID) Reset

func (x *PID) Reset()

func (*PID) String

func (x *PID) String() string

type RemoteClient

type RemoteClient interface {
	OnMessage(ctx context.Context, in *OnMessageRequest, opts ...grpc.CallOption) (*OnMessageReply, error)
}

RemoteClient is the client API for Remote 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 NewRemoteClient

func NewRemoteClient(cc grpc.ClientConnInterface) RemoteClient

type RemoteServer

type RemoteServer interface {
	OnMessage(context.Context, *OnMessageRequest) (*OnMessageReply, error)
	// contains filtered or unexported methods
}

RemoteServer is the server API for Remote service. All implementations must embed UnimplementedRemoteServer for forward compatibility

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(node core.Node, addr string) *Server

func (*Server) Address

func (s *Server) Address() string

func (*Server) OnMessage

func (s *Server) OnMessage(ctx context.Context, in *OnMessageRequest) (*OnMessageReply, error)

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop()

type UnimplementedRemoteServer

type UnimplementedRemoteServer struct {
}

UnimplementedRemoteServer must be embedded to have forward compatible implementations.

func (UnimplementedRemoteServer) OnMessage

type UnsafeRemoteServer

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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