Documentation ¶
Index ¶
- func Serve(opts ...ServeContextOption) error
- type GRPCGateway
- type GRPCServer
- type ServeContext
- type ServeContextOption
- func WithContext(ctx context.Context) ServeContextOption
- func WithGRPC() ServeContextOption
- func WithGRPCGateway() ServeContextOption
- func WithOnExit(cb func()) ServeContextOption
- func WithOnListen(cb func()) ServeContextOption
- func WithPort(port string) ServeContextOption
- func WithPubSub() ServeContextOption
- func WithServices(s ...interface{}) ServeContextOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Serve ¶
func Serve(opts ...ServeContextOption) error
Types ¶
type GRPCGateway ¶
type GRPCGateway interface {
RegisterGateway(ctx context.Context, mux *runtime.ServeMux, bind string, opts []grpc.DialOption) error
}
GRPCGateway is any structure that implements the RegisterGateway method which registers a new gateway to the http mux.
type GRPCServer ¶
GRPCServer is any structure that implements the Register method for grpc server registration.
type ServeContext ¶
type ServeContext struct {
// contains filtered or unexported fields
}
ServeContext encapsulates services and hooks for the Serve
type ServeContextOption ¶
type ServeContextOption func(c *ServeContext)
ServeContextOption allows setup of the ServeContext
func WithContext ¶
func WithContext(ctx context.Context) ServeContextOption
WithContext sets the ServeContext context. The context is then used within the grpc gateway connections.
func WithGRPCGateway ¶
func WithGRPCGateway() ServeContextOption
WithGRPCGateway enables gateway capabilities of the server
func WithOnExit ¶
func WithOnExit(cb func()) ServeContextOption
WithOnExit adds the onExit callback fired when the service is exiting
func WithOnListen ¶
func WithOnListen(cb func()) ServeContextOption
WithOnListen adds the onListen callback fired when the listening starts
func WithPort ¶
func WithPort(port string) ServeContextOption
WithPort sets the port of the context. If no port is set, one will be picked by the system
func WithPubSub ¶
func WithPubSub() ServeContextOption
WithPubSub enables PubSub capabilities of the server. Enabling PubSub also enables the gateway option
func WithServices ¶
func WithServices(s ...interface{}) ServeContextOption
WithServices adds services that should be registered within the multiplexer