Documentation ¶
Index ¶
- func GRPC(l logrus.FieldLogger, m metrics.Provider, server grpcserver.Starter, ...) cmdutil.Server
- func HTTP(l logrus.FieldLogger, m metrics.Provider, h http.Handler, ...) cmdutil.Server
- func SkipEnforceHTTPS() func(*httpOptions)
- func WithTLSConfig(tlscfg *tls.Config) func(*httpOptions)
- type OptionFunc
- type Standard
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GRPC ¶
func GRPC( l logrus.FieldLogger, m metrics.Provider, server grpcserver.Starter, grpcOpts ...grpcserver.ServerOption) cmdutil.Server
GRPC returns a standard GRPC server for the provided handler. Router-bypass and TLS config are inferred from the environment.
Currently only supports running in router-bypass mode, unlike HTTP.
func HTTP ¶
func HTTP(l logrus.FieldLogger, m metrics.Provider, h http.Handler, opts ...func(*httpOptions)) cmdutil.Server
HTTP returns a standard HTTP server for the provided handler. Port, TLS, and router-bypass config are inferred from the environment.
func SkipEnforceHTTPS ¶
func SkipEnforceHTTPS() func(*httpOptions)
SkipEnforceHTTPS allows services to opt-out of SSL enforcement required for productionization. It should only be used in environments where SSL is not available.
func WithTLSConfig ¶
WithTLSConfig allows services to use a specific TLS configuration instead of the default one constructed from environment variables.
Types ¶
type OptionFunc ¶
type OptionFunc func(*options)
OptionFunc is a function that modifies internal service options.
func CustomMetricsSuffix ¶
func CustomMetricsSuffix(s string) OptionFunc
CustomMetricsSuffix is an OptionFunc that has New use the given suffix on metrics recorded with MetricsProvider instead of inferring it from DYNO.
func SkipMetricsSuffix ¶
func SkipMetricsSuffix() OptionFunc
SkipMetricsSuffix is an OptionFunc that has New skip automatically adding the process type from DYNO as a suffix on metrics recorded with MetricsProvider.
type Standard ¶
type Standard struct { App string Deploy string Logger logrus.FieldLogger MetricsProvider xmetrics.Provider // contains filtered or unexported fields }
Standard is a standard service.
func New ¶
func New(appConfig interface{}, ofs ...OptionFunc) *Standard
New returns a Standard service with logging, rollbar, metrics, debugging, and common signal handling.
It calls envdecode.MustStrictDecode on the provided appConfig.