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 to be added to metrics recorded by the MetricsProvider instead of inferring it from $DYNO.
func EnableOpenCensusTracing ¶ added in v0.0.12
func EnableOpenCensusTracing() OptionFunc
EnableOpenCensusTracing on the Service by registering and starting an open census agent exporter.
func SkipMetricsSuffix ¶
func SkipMetricsSuffix() OptionFunc
SkipMetricsSuffix prevents the Service from suffixing the process type to metric names recorded by the MetricsProvider. The default suffix is determined from $DYNO.
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 Standard Service with logging, rollbar, metrics, debugging, common signal handling, and possibly more. envdecode.MustStrictDecode is called on the provided appConfig to ensure that it is processed.