Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrDiscarded is returned when there is no slots // in process stream ErrDiscarded = errors.New("discarded") )
var File_api_proto protoreflect.FileDescriptor
Functions ¶
func RegisterWorkerServer ¶
func RegisterWorkerServer(s *grpc.Server, srv WorkerServer)
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client connect to a remote grpc endpoint
func NewClient ¶
func NewClient(opts ClientOptions) *Client
NewClient create a new Client with given options
type Error ¶
type Error struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*Error) Descriptor
deprecated
func (*Error) GetMessage ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) ProtoReflect ¶ added in v0.12.0
func (x *Error) ProtoReflect() protoreflect.Message
type Message ¶
type Message struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*Message) Descriptor
deprecated
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶ added in v0.12.0
func (x *Message) ProtoReflect() protoreflect.Message
type Server ¶
type Server struct { UnimplementedWorkerServer // contains filtered or unexported fields }
Server receive data from a remote endpoint
func NewServer ¶
func NewServer(opts ServerOptions) *Server
NewServer create a new grpc server with given options
type ServerOptions ¶
ServerOptions customize Server Worker
type UnimplementedWorkerServer ¶
type UnimplementedWorkerServer struct { }
UnimplementedWorkerServer must be embedded to have forward compatible implementations.
type UnsafeWorkerServer ¶ added in v0.12.0
type UnsafeWorkerServer interface {
// contains filtered or unexported methods
}
UnsafeWorkerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WorkerServer will result in compilation errors.
type WorkerClient ¶
type WorkerClient interface {
Send(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Error, error)
}
WorkerClient is the client API for Worker 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 NewWorkerClient ¶
func NewWorkerClient(cc grpc.ClientConnInterface) WorkerClient