Documentation ¶
Overview ¶
Package services helps to initialize services & applications.
Index ¶
- func IsLocal() bool
- func ProtoConfigFilename(app, filename string) string
- func Version() string
- type AtExitFn
- type Service
- func (service *Service) AtExit(fn AtExitFn)
- func (service *Service) ConfigureGRPC()
- func (service *Service) ConfigureProfiler()
- func (service *Service) ConfigureRouting(opts ...routing.ServerOption)
- func (service *Service) ConfigureSentry(dsn string)
- func (service *Service) GRPCServer() *grpc.Server
- func (service *Service) RoutingServer() *routing.Server
- func (service *Service) Run()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsLocal ¶
func IsLocal() bool
IsLocal returns true if we are running inside a local debug environment instead of a production Kubernetes container. It dependes on Version() working correctly.
func ProtoConfigFilename ¶ added in v1.8.0
ProtoConfigFilename returns the standard location for Altipla config files for the named app.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service stores the configuration of the service we are configuring.
func Init ¶
Init the configuration of a new service for the current application with the provided name.
func (*Service) ConfigureGRPC ¶
func (service *Service) ConfigureGRPC()
ConfigureGRPC enables a GRPC server.
func (*Service) ConfigureProfiler ¶
func (service *Service) ConfigureProfiler()
ConfigureProfiler enables the Stackdriver Profiler agent.
func (*Service) ConfigureRouting ¶
func (service *Service) ConfigureRouting(opts ...routing.ServerOption)
ConfigureRouting enables a HTTP router with the custom options we need. Logrus will be always enabled and Sentry will be configured if a DSN is provided in the ConfigureSentry call.
func (*Service) ConfigureSentry ¶
ConfigureSentry enables Sentry support in all the features that support it.
func (*Service) GRPCServer ¶
GRPCServer returns the server to register new GRPC services on it.
func (*Service) RoutingServer ¶
RoutingServer returns the server to register new HTTP routes on it.