option

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2019 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MsOption

type MsOption func(*MsOptions)

func Address

func Address(address string) MsOption

func ID

func ID(id string) MsOption

func Name

func Name(name string) MsOption

func WitStreamLoggingMiddleware

func WitStreamLoggingMiddleware(logger *zap.Logger) MsOption

func WitStreamPrometheusMiddleware

func WitStreamPrometheusMiddleware() MsOption

func WitUnaryLoggingMiddleware

func WitUnaryLoggingMiddleware(logger *zap.Logger) MsOption

func WitUnaryPrometheusMiddleware

func WitUnaryPrometheusMiddleware() MsOption

func WithConnTimeout

func WithConnTimeout(t time.Duration) MsOption

WithStatsHandler ConnectionTimeout returns a ServerOption that sets the timeout for connection establishment (up to and including HTTP/2 handshaking) for all new connections. If this is not set, the default is 120 seconds.

func WithHTTPMiddleware

func WithHTTPMiddleware(mw func(http.Handler) http.Handler) MsOption

func WithHealthz

func WithHealthz() MsOption

func WithMaxConcurrentStreams

func WithMaxConcurrentStreams(num uint32) MsOption

WithMaxConcurrentStreams returns a ServerOption that will apply a limit on the number of concurrent streams to each ServerTransport.

func WithReflection

func WithReflection() MsOption

WithReflection adds grpc server reflection to the list of Services ref: https://godoc.org/google.golang.org/grpc/reflection

func WithRestIncomingHeaderMatcher

func WithRestIncomingHeaderMatcher(matcher runtime.HeaderMatcherFunc) MsOption

func WithRestLoggingMiddleware

func WithRestLoggingMiddleware(logger *zap.Logger) MsOption

func WithRestMarshaler

func WithRestMarshaler(mime string, msh runtime.Marshaler) MsOption

grpc-gateway options

func WithRestOutgoingHeaderMatcher

func WithRestOutgoingHeaderMatcher(matcher runtime.HeaderMatcherFunc) MsOption

func WithRestServices

func WithRestServices(services ...restMw.RestService) MsOption

func WithServices

func WithServices(services ...middleware.GrpcService) MsOption

type MsOptions

type MsOptions struct {
	Name               string
	ID                 string
	Address            string
	Version            string
	Services           []middleware.GrpcService
	RestServices       []restMw.RestService
	UnaryInterceptors  []grpc.UnaryServerInterceptor
	StreamInterceptors []grpc.StreamServerInterceptor
	GrpcOptions        []grpc.ServerOption
	RestOptions        []runtime.ServeMuxOption
	RestMiddleware     alice.Chain

	UsePrometheus bool
}

func New

func New(options ...MsOption) *MsOptions

func (*MsOptions) ServerOptions

func (c *MsOptions) ServerOptions() []grpc.ServerOption

Jump to

Keyboard shortcuts

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