Documentation ¶
Overview ¶
Package callback - provide GRPC API to perform client callbacks.
Package callback - provide GRPC API to perform client callbacks.
Index ¶
- Variables
- func IdentityByAuthority(ctx context.Context) (string, error)
- func RegisterCallbackServiceServer(s *grpc.Server, srv CallbackServiceServer)
- type CallbackData
- func (*CallbackData) Descriptor() ([]byte, []int)deprecated
- func (x *CallbackData) GetData() []byte
- func (x *CallbackData) GetKind() DataKind
- func (*CallbackData) ProtoMessage()
- func (x *CallbackData) ProtoReflect() protoreflect.Message
- func (x *CallbackData) Reset()
- func (x *CallbackData) String() string
- type CallbackServiceClient
- type CallbackServiceServer
- type CallbackService_HandleCallbacksClient
- type CallbackService_HandleCallbacksServer
- type Client
- type ClientListener
- type DataKind
- type IdentityProvider
- type Server
- type UnimplementedCallbackServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( DataKind_name = map[int32]string{ 0: "Data", 1: "Close", } DataKind_value = map[string]int32{ "Data": 0, "Close": 1, } )
Enum value maps for DataKind.
var File_callback_proto protoreflect.FileDescriptor
Functions ¶
func IdentityByAuthority ¶
IdentityByAuthority - return identity by :authority
func RegisterCallbackServiceServer ¶
func RegisterCallbackServiceServer(s *grpc.Server, srv CallbackServiceServer)
Types ¶
type CallbackData ¶
type CallbackData struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` Kind DataKind `protobuf:"varint,2,opt,name=kind,proto3,enum=callback.DataKind" json:"kind,omitempty"` // contains filtered or unexported fields }
Callback binary stream
func (*CallbackData) Descriptor
deprecated
func (*CallbackData) Descriptor() ([]byte, []int)
Deprecated: Use CallbackData.ProtoReflect.Descriptor instead.
func (*CallbackData) GetData ¶
func (x *CallbackData) GetData() []byte
func (*CallbackData) GetKind ¶
func (x *CallbackData) GetKind() DataKind
func (*CallbackData) ProtoMessage ¶
func (*CallbackData) ProtoMessage()
func (*CallbackData) ProtoReflect ¶
func (x *CallbackData) ProtoReflect() protoreflect.Message
func (*CallbackData) Reset ¶
func (x *CallbackData) Reset()
func (*CallbackData) String ¶
func (x *CallbackData) String() string
type CallbackServiceClient ¶
type CallbackServiceClient interface {
HandleCallbacks(ctx context.Context, opts ...grpc.CallOption) (CallbackService_HandleCallbacksClient, error)
}
CallbackServiceClient is the client API for CallbackService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewCallbackServiceClient ¶
func NewCallbackServiceClient(cc grpc.ClientConnInterface) CallbackServiceClient
type CallbackServiceServer ¶
type CallbackServiceServer interface {
HandleCallbacks(CallbackService_HandleCallbacksServer) error
}
CallbackServiceServer is the server API for CallbackService service.
type CallbackService_HandleCallbacksClient ¶
type CallbackService_HandleCallbacksClient interface { Send(*CallbackData) error Recv() (*CallbackData, error) grpc.ClientStream }
type CallbackService_HandleCallbacksServer ¶
type CallbackService_HandleCallbacksServer interface { Send(*CallbackData) error Recv() (*CallbackData, error) grpc.ServerStream }
type Client ¶
type Client interface { // Context - return context Context() context.Context // Stop - stop all operations Stop() // Server - perform opertaions on local GRPC server and call for remote server. Serve(ctx context.Context) // ErrChan - return error stream ErrChan() chan error }
Client - a callback server client, main functionality is to serve local grpc and perform operations on it.
type ClientListener ¶
ClientListener - inform server about new client is arrived or disconnected.
type DataKind ¶
type DataKind int32
func (DataKind) Descriptor ¶
func (DataKind) Descriptor() protoreflect.EnumDescriptor
func (DataKind) EnumDescriptor
deprecated
func (DataKind) Number ¶
func (x DataKind) Number() protoreflect.EnumNumber
func (DataKind) Type ¶
func (DataKind) Type() protoreflect.EnumType
type IdentityProvider ¶
IdentityProvider - A function to retrieve identity from grpc connection context and create clients based on it.
type Server ¶
type Server interface { AddListener(listener ClientListener) WithCallbackDialer() grpc.DialOption CallbackServiceServer }
Server - a callback server, hold client callback connections and allow to provide client
func NewServer ¶
func NewServer(provider IdentityProvider) Server
NewServer - creates a new callback server to handle clients, should be used to create client connections back to client.
type UnimplementedCallbackServiceServer ¶
type UnimplementedCallbackServiceServer struct { }
UnimplementedCallbackServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedCallbackServiceServer) HandleCallbacks ¶
func (*UnimplementedCallbackServiceServer) HandleCallbacks(CallbackService_HandleCallbacksServer) error