Documentation ¶
Overview ¶
Package serverenv defines common parameters for the sever environment.
Index ¶
- type ExporterFunc
- type Option
- func WithAuthorizedAppProvider(p authorizedapp.Provider) Option
- func WithBlobStorage(sto storage.Blobstore) Option
- func WithDatabase(db *database.DB) Option
- func WithKeyManager(km keys.KeyManager) Option
- func WithMetricsExporter(f metrics.ExporterFromContext) Option
- func WithObservabilityExporter(oe observability.Exporter) Option
- func WithSecretManager(sm secrets.SecretManager) Option
- type ServerEnv
- func (s *ServerEnv) AuthorizedAppProvider() authorizedapp.Provider
- func (s *ServerEnv) Blobstore() storage.Blobstore
- func (s *ServerEnv) Close(ctx context.Context) error
- func (s *ServerEnv) Database() *database.DB
- func (s *ServerEnv) GetSignerForKey(ctx context.Context, keyName string) (crypto.Signer, error)
- func (s *ServerEnv) KeyManager() keys.KeyManager
- func (s *ServerEnv) MetricsExporter(ctx context.Context) metrics.Exporter
- func (s *ServerEnv) ObservabilityExporter() observability.Exporter
- func (s *ServerEnv) SecretManager() secrets.SecretManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExporterFunc ¶
ExporterFunc defines a factory function for creating a context aware metrics exporter.
type Option ¶
Option defines function types to modify the ServerEnv on creation.
func WithAuthorizedAppProvider ¶
func WithAuthorizedAppProvider(p authorizedapp.Provider) Option
WithAuthorizedAppProvider installs a provider for an authorized app.
func WithBlobStorage ¶
WithBlobStorage creates an Option to install a specific Blob storage system.
func WithDatabase ¶
WithDatabase attached a database to the environment.
func WithKeyManager ¶
func WithKeyManager(km keys.KeyManager) Option
WithKeyManager creates an Option to install a specific KeyManager to use for signing requests.
func WithMetricsExporter ¶
func WithMetricsExporter(f metrics.ExporterFromContext) Option
WithMetricsExporter creates an Option to install a different metrics exporter.
func WithObservabilityExporter ¶
func WithObservabilityExporter(oe observability.Exporter) Option
WithObservabilityExporter creates an Option to install a specific observability exporter system.
func WithSecretManager ¶
func WithSecretManager(sm secrets.SecretManager) Option
WithSecretManager creates an Option to install a specific secret manager to use.
type ServerEnv ¶
type ServerEnv struct {
// contains filtered or unexported fields
}
ServerEnv represents latent environment configuration for servers in this application.
func (*ServerEnv) AuthorizedAppProvider ¶
func (s *ServerEnv) AuthorizedAppProvider() authorizedapp.Provider
func (*ServerEnv) GetSignerForKey ¶
GetSignerForKey returns the crypto.Singer implementation to use based on the installed KeyManager. If there is no KeyManager installed, this returns an error.
func (*ServerEnv) KeyManager ¶
func (s *ServerEnv) KeyManager() keys.KeyManager
func (*ServerEnv) MetricsExporter ¶
MetricsExporter returns a context appropriate metrics exporter.
func (*ServerEnv) ObservabilityExporter ¶
func (s *ServerEnv) ObservabilityExporter() observability.Exporter
func (*ServerEnv) SecretManager ¶
func (s *ServerEnv) SecretManager() secrets.SecretManager