messaging

package
v0.0.0-...-ad8c3e4 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package messaging is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
var File_messaging_proto protoreflect.FileDescriptor
View Source
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) Enum

func (DispatchResult_Status) EnumDescriptor deprecated

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

Deprecated: Use DispatchResult_Status.Descriptor instead.

func (DispatchResult_Status) Number

func (DispatchResult_Status) String

func (x DispatchResult_Status) String() string

func (DispatchResult_Status) Type

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) Descriptor() ([]byte, []int)

Deprecated: Use Envelope.ProtoReflect.Descriptor instead.

func (*Envelope) GetBody

func (x *Envelope) GetBody() *structpb.Value

func (*Envelope) GetHeaders

func (x *Envelope) GetHeaders() *Headers

func (*Envelope) GetProperties

func (x *Envelope) GetProperties() *structpb.Value

func (*Envelope) ProtoMessage

func (*Envelope) ProtoMessage()

func (*Envelope) ProtoReflect

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

func (*Envelope) Reset

func (x *Envelope) Reset()

func (*Envelope) String

func (x *Envelope) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Headers.ProtoReflect.Descriptor instead.

func (*Headers) GetId

func (x *Headers) GetId() *UUID

func (*Headers) ProtoMessage

func (*Headers) ProtoMessage()

func (*Headers) ProtoReflect

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

func (*Headers) Reset

func (x *Headers) Reset()

func (*Headers) String

func (x *Headers) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use UUID.ProtoReflect.Descriptor instead.

func (*UUID) GetHi

func (x *UUID) GetHi() uint64

func (*UUID) GetLo

func (x *UUID) GetLo() uint64

func (*UUID) ProtoMessage

func (*UUID) ProtoMessage()

func (*UUID) ProtoReflect

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

func (*UUID) Reset

func (x *UUID) Reset()

func (*UUID) String

func (x *UUID) String() string

type UnimplementedMessengerServer

type UnimplementedMessengerServer struct {
}

UnimplementedMessengerServer must be embedded to have forward compatible implementations.

func (UnimplementedMessengerServer) Dispatch

func (UnimplementedMessengerServer) DispatchQueue

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.

Jump to

Keyboard shortcuts

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