Documentation ¶
Index ¶
- Constants
- Variables
- type BootstrapGrpcOptions
- type DialOptions
- type GrpcMethodName
- type Service
- func (bs *Service) Bootstrap(cliCtx *cli.Context) error
- func (bs *Service) BootstrapGrpc(ctx context.Context, cliCtx *cli.Context, opts *BootstrapGrpcOptions) error
- func (bs *Service) BootstrapHTTP(ctx context.Context, cliCtx *cli.Context, handler *echo.Echo, ...) error
- func (bs *Service) ConfigureLogging(cliCtx *cli.Context)
- func (bs *Service) ConfigureTracing(cliCtx *cli.Context) (io.Closer, error)
- func (bs *Service) Connect(cliCtx *cli.Context) error
- func (bs *Service) Dial(ctx context.Context, host string, port uint, opts *DialOptions) (*grpc.ClientConn, error)
- func (bs *Service) GracefulStop()
- func (bs *Service) ServeGrpc(listener net.Listener) error
- func (bs *Service) SetHealthy(healthy bool)
- func (bs *Service) SetLogFormat(format logrus.Formatter)
- func (bs *Service) SetLogLevel(level logrus.Level)
- func (bs *Service) SetupGrpcHealthCheck(ctx context.Context)
- func (bs *Service) SetupHTTPHealthCheck(ctx context.Context, handler *echo.Echo, url string)
- type WrappedServerStream
Constants ¶
View Source
const Version = "0.0.9"
Version is incremented using bump2version
Variables ¶
View Source
var ( // GrpcMethodDescriptor ... GrpcMethodDescriptor = grpcMethodDescriptor("methodDesc") // NotReady ... NotReady = status.Error(codes.Unavailable, "the service is currently unavailable") )
Functions ¶
This section is empty.
Types ¶
type BootstrapGrpcOptions ¶
type BootstrapGrpcOptions struct { USI grpc.UnaryServerInterceptor SSI grpc.StreamServerInterceptor }
BootstrapGrpcOptions ...
type Service ¶
type Service struct { Name string Version string BuildTime string Echo *echo.Echo HTTPServer *http.Server GrpcServer *grpc.Server Health *health.Server TracerCloser io.Closer Ready bool Healthy bool // Hooks PostBootstrapHook func(bs *Service) error ConnectHook func(bs *Service) error // Configuration HTTPHealthCheckURL string // contains filtered or unexported fields }
Service ...
func (*Service) BootstrapGrpc ¶
func (bs *Service) BootstrapGrpc(ctx context.Context, cliCtx *cli.Context, opts *BootstrapGrpcOptions) error
BootstrapGrpc prepares a grpc service
func (*Service) BootstrapHTTP ¶
func (bs *Service) BootstrapHTTP(ctx context.Context, cliCtx *cli.Context, handler *echo.Echo, mws []echo.MiddlewareFunc) error
BootstrapHTTP prepares an http service
func (*Service) ConfigureLogging ¶
func (bs *Service) ConfigureLogging(cliCtx *cli.Context)
ConfigureLogging ...
func (*Service) ConfigureTracing ¶
ConfigureTracing ...
func (*Service) Dial ¶
func (bs *Service) Dial(ctx context.Context, host string, port uint, opts *DialOptions) (*grpc.ClientConn, error)
Dial connects to an external GRPC service
func (*Service) SetLogFormat ¶ added in v0.0.5
SetLogFormat ...
func (*Service) SetLogLevel ¶ added in v0.0.5
SetLogLevel ...
func (*Service) SetupGrpcHealthCheck ¶
SetupGrpcHealthCheck ...
type WrappedServerStream ¶
type WrappedServerStream struct { grpc.ServerStream // WrappedContext is the wrapper's own Context. You can assign it. WrappedContext context.Context }
WrappedServerStream is a thin wrapper around grpc.ServerStream that allows modifying context.
func WrapServerStream ¶
func WrapServerStream(stream grpc.ServerStream) *WrappedServerStream
WrapServerStream returns a ServerStream that has the ability to overwrite context.
func (*WrappedServerStream) Context ¶
func (w *WrappedServerStream) Context() context.Context
Context returns the wrapper's WrappedContext, overwriting the nested grpc.ServerStream.Context()
Click to show internal directories.
Click to hide internal directories.