Documentation ¶
Overview ¶
Package messaging is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterMessengerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterMessengerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MessengerClient) error
- func RegisterMessengerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterMessengerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MessengerServer) error
- func RegisterMessengerServer(s grpc.ServiceRegistrar, srv MessengerServer)
- type DispatchResult
- func (*DispatchResult) Descriptor() ([]byte, []int)deprecated
- func (x *DispatchResult) GetErrors() []string
- func (x *DispatchResult) GetId() *UUID
- func (x *DispatchResult) GetStatus() DispatchResult_Status
- func (*DispatchResult) ProtoMessage()
- func (x *DispatchResult) ProtoReflect() protoreflect.Message
- func (x *DispatchResult) Reset()
- func (x *DispatchResult) String() string
- type DispatchResult_Status
- func (DispatchResult_Status) Descriptor() protoreflect.EnumDescriptor
- func (x DispatchResult_Status) Enum() *DispatchResult_Status
- func (DispatchResult_Status) EnumDescriptor() ([]byte, []int)deprecated
- func (x DispatchResult_Status) Number() protoreflect.EnumNumber
- func (x DispatchResult_Status) String() string
- func (DispatchResult_Status) Type() protoreflect.EnumType
- type Envelope
- func (*Envelope) Descriptor() ([]byte, []int)deprecated
- func (x *Envelope) GetBody() *structpb.Value
- func (x *Envelope) GetHeaders() *Headers
- func (x *Envelope) GetProperties() *structpb.Value
- func (*Envelope) ProtoMessage()
- func (x *Envelope) ProtoReflect() protoreflect.Message
- func (x *Envelope) Reset()
- func (x *Envelope) String() string
- type EnvelopeList
- type Headers
- type MessengerClient
- type MessengerServer
- type UUID
- type UnimplementedMessengerServer
- type UnsafeMessengerServer
Constants ¶
This section is empty.
Variables ¶
var ( DispatchResult_Status_name = map[int32]string{ 0: "Success", 1: "Fail", } DispatchResult_Status_value = map[string]int32{ "Success": 0, "Fail": 1, } )
Enum value maps for DispatchResult_Status.
var File_messaging_proto protoreflect.FileDescriptor
var Messenger_ServiceDesc = grpc.ServiceDesc{ ServiceName: "messaging.Messenger", HandlerType: (*MessengerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Dispatch", Handler: _Messenger_Dispatch_Handler, }, { MethodName: "DispatchQueue", Handler: _Messenger_DispatchQueue_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "messaging.proto", }
Messenger_ServiceDesc is the grpc.ServiceDesc for Messenger service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterMessengerHandler ¶
func RegisterMessengerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterMessengerHandler registers the http handlers for service Messenger to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterMessengerHandlerClient ¶
func RegisterMessengerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MessengerClient) error
RegisterMessengerHandlerClient registers the http handlers for service Messenger to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MessengerClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MessengerClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "MessengerClient" to call the correct interceptors.
func RegisterMessengerHandlerFromEndpoint ¶
func RegisterMessengerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterMessengerHandlerFromEndpoint is same as RegisterMessengerHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterMessengerHandlerServer ¶
func RegisterMessengerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MessengerServer) error
RegisterMessengerHandlerServer registers the http handlers for service Messenger to "mux". UnaryRPC :call MessengerServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMessengerHandlerFromEndpoint instead.
func RegisterMessengerServer ¶
func RegisterMessengerServer(s grpc.ServiceRegistrar, srv MessengerServer)
Types ¶
type DispatchResult ¶
type DispatchResult struct { Status DispatchResult_Status `protobuf:"varint,1,opt,name=status,proto3,enum=messaging.DispatchResult_Status" json:"status,omitempty"` Id *UUID `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` Errors []string `protobuf:"bytes,3,rep,name=errors,proto3" json:"errors,omitempty"` // contains filtered or unexported fields }
func (*DispatchResult) Descriptor
deprecated
func (*DispatchResult) Descriptor() ([]byte, []int)
Deprecated: Use DispatchResult.ProtoReflect.Descriptor instead.
func (*DispatchResult) GetErrors ¶
func (x *DispatchResult) GetErrors() []string
func (*DispatchResult) GetId ¶
func (x *DispatchResult) GetId() *UUID
func (*DispatchResult) GetStatus ¶
func (x *DispatchResult) GetStatus() DispatchResult_Status
func (*DispatchResult) ProtoMessage ¶
func (*DispatchResult) ProtoMessage()
func (*DispatchResult) ProtoReflect ¶
func (x *DispatchResult) ProtoReflect() protoreflect.Message
func (*DispatchResult) Reset ¶
func (x *DispatchResult) Reset()
func (*DispatchResult) String ¶
func (x *DispatchResult) String() string
type DispatchResult_Status ¶
type DispatchResult_Status int32
const ( DispatchResult_Success DispatchResult_Status = 0 DispatchResult_Fail DispatchResult_Status = 1 )
func (DispatchResult_Status) Descriptor ¶
func (DispatchResult_Status) Descriptor() protoreflect.EnumDescriptor
func (DispatchResult_Status) Enum ¶
func (x DispatchResult_Status) Enum() *DispatchResult_Status
func (DispatchResult_Status) EnumDescriptor
deprecated
func (DispatchResult_Status) EnumDescriptor() ([]byte, []int)
Deprecated: Use DispatchResult_Status.Descriptor instead.
func (DispatchResult_Status) Number ¶
func (x DispatchResult_Status) Number() protoreflect.EnumNumber
func (DispatchResult_Status) String ¶
func (x DispatchResult_Status) String() string
func (DispatchResult_Status) Type ¶
func (DispatchResult_Status) Type() protoreflect.EnumType
type Envelope ¶
type Envelope struct { Headers *Headers `protobuf:"bytes,1,opt,name=headers,proto3" json:"headers,omitempty"` Body *structpb.Value `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` Properties *structpb.Value `protobuf:"bytes,3,opt,name=properties,proto3" json:"properties,omitempty"` // contains filtered or unexported fields }
func (*Envelope) Descriptor
deprecated
func (*Envelope) GetHeaders ¶
func (*Envelope) GetProperties ¶
func (*Envelope) ProtoMessage ¶
func (*Envelope) ProtoMessage()
func (*Envelope) ProtoReflect ¶
func (x *Envelope) ProtoReflect() protoreflect.Message
type EnvelopeList ¶
type EnvelopeList struct { Envelopes []*Envelope `protobuf:"bytes,1,rep,name=envelopes,proto3" json:"envelopes,omitempty"` // contains filtered or unexported fields }
func (*EnvelopeList) Descriptor
deprecated
func (*EnvelopeList) Descriptor() ([]byte, []int)
Deprecated: Use EnvelopeList.ProtoReflect.Descriptor instead.
func (*EnvelopeList) GetEnvelopes ¶
func (x *EnvelopeList) GetEnvelopes() []*Envelope
func (*EnvelopeList) ProtoMessage ¶
func (*EnvelopeList) ProtoMessage()
func (*EnvelopeList) ProtoReflect ¶
func (x *EnvelopeList) ProtoReflect() protoreflect.Message
func (*EnvelopeList) Reset ¶
func (x *EnvelopeList) Reset()
func (*EnvelopeList) String ¶
func (x *EnvelopeList) String() string
type Headers ¶
type Headers struct { Id *UUID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*Headers) Descriptor
deprecated
func (*Headers) ProtoMessage ¶
func (*Headers) ProtoMessage()
func (*Headers) ProtoReflect ¶
func (x *Headers) ProtoReflect() protoreflect.Message
type MessengerClient ¶
type MessengerClient interface { Dispatch(ctx context.Context, in *Envelope, opts ...grpc.CallOption) (*DispatchResult, error) DispatchQueue(ctx context.Context, in *EnvelopeList, opts ...grpc.CallOption) (*DispatchResult, error) }
MessengerClient is the client API for Messenger 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 NewMessengerClient ¶
func NewMessengerClient(cc grpc.ClientConnInterface) MessengerClient
type MessengerServer ¶
type MessengerServer interface { Dispatch(context.Context, *Envelope) (*DispatchResult, error) DispatchQueue(context.Context, *EnvelopeList) (*DispatchResult, error) // contains filtered or unexported methods }
MessengerServer is the server API for Messenger service. All implementations must embed UnimplementedMessengerServer for forward compatibility
type UUID ¶
type UUID struct { Hi uint64 `protobuf:"varint,1,opt,name=hi,proto3" json:"hi,omitempty"` Lo uint64 `protobuf:"varint,2,opt,name=lo,proto3" json:"lo,omitempty"` // contains filtered or unexported fields }
func (*UUID) Descriptor
deprecated
func (*UUID) ProtoMessage ¶
func (*UUID) ProtoMessage()
func (*UUID) ProtoReflect ¶
func (x *UUID) ProtoReflect() protoreflect.Message
type UnimplementedMessengerServer ¶
type UnimplementedMessengerServer struct { }
UnimplementedMessengerServer must be embedded to have forward compatible implementations.
func (UnimplementedMessengerServer) Dispatch ¶
func (UnimplementedMessengerServer) Dispatch(context.Context, *Envelope) (*DispatchResult, error)
func (UnimplementedMessengerServer) DispatchQueue ¶
func (UnimplementedMessengerServer) DispatchQueue(context.Context, *EnvelopeList) (*DispatchResult, error)
type UnsafeMessengerServer ¶
type UnsafeMessengerServer interface {
// contains filtered or unexported methods
}
UnsafeMessengerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MessengerServer will result in compilation errors.