exposure-notifications-server: github.com/google/exposure-notifications-server/internal/serverenv Index | Files

package serverenv

import "github.com/google/exposure-notifications-server/internal/serverenv"

Package serverenv defines common parameters for the sever environment.

Index

Package Files

env.go

type ExporterFunc Uses

type ExporterFunc func(context.Context) metrics.Exporter

ExporterFunc defines a factory function for creating a context aware metrics exporter.

type Option Uses

type Option func(*ServerEnv) *ServerEnv

Option defines function types to modify the ServerEnv on creation.

func WithAuthorizedAppProvider Uses

func WithAuthorizedAppProvider(p authorizedapp.Provider) Option

WithAuthorizedAppProvider installs a provider for an authorized app.

func WithBlobStorage Uses

func WithBlobStorage(sto storage.Blobstore) Option

WithBlobStorage creates an Option to install a specific Blob storage system.

func WithDatabase Uses

func WithDatabase(db *database.DB) Option

WithDatabase attached a database to the environment.

func WithJwksManager Uses

func WithJwksManager(mgr jwks.Manager) Option

WithJwksManager creates an Option to install the JWKS manager.

func WithKeyManager Uses

func WithKeyManager(km keys.KeyManager) Option

WithKeyManager creates an Option to install a specific KeyManager to use for signing requests.

func WithMetricsExporter Uses

func WithMetricsExporter(f metrics.ExporterFromContext) Option

WithMetricsExporter creates an Option to install a different metrics exporter.

func WithObservabilityExporter Uses

func WithObservabilityExporter(oe observability.Exporter) Option

WithObservabilityExporter creates an Option to install a specific observability exporter system.

func WithSecretManager Uses

func WithSecretManager(sm secrets.SecretManager) Option

WithSecretManager creates an Option to install a specific secret manager to use.

type ServerEnv Uses

type ServerEnv struct {
    // contains filtered or unexported fields
}

ServerEnv represents latent environment configuration for servers in this application.

func New Uses

func New(ctx context.Context, opts ...Option) *ServerEnv

New creates a new ServerEnv with the requested options.

func (*ServerEnv) AuthorizedAppProvider Uses

func (s *ServerEnv) AuthorizedAppProvider() authorizedapp.Provider

func (*ServerEnv) Blobstore Uses

func (s *ServerEnv) Blobstore() storage.Blobstore

func (*ServerEnv) Close Uses

func (s *ServerEnv) Close(ctx context.Context) error

Close shuts down the server env, closing database connections, etc.

func (*ServerEnv) Database Uses

func (s *ServerEnv) Database() *database.DB

func (*ServerEnv) GetKeyManager Uses

func (s *ServerEnv) GetKeyManager() keys.KeyManager

func (*ServerEnv) GetSignerForKey Uses

func (s *ServerEnv) GetSignerForKey(ctx context.Context, keyName string) (crypto.Signer, error)

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) JwksManager Uses

func (s *ServerEnv) JwksManager() jwks.Manager

func (*ServerEnv) KeyManager Uses

func (s *ServerEnv) KeyManager() keys.KeyManager

func (*ServerEnv) MetricsExporter Uses

func (s *ServerEnv) MetricsExporter(ctx context.Context) metrics.Exporter

MetricsExporter returns a context appropriate metrics exporter.

func (*ServerEnv) ObservabilityExporter Uses

func (s *ServerEnv) ObservabilityExporter() observability.Exporter

func (*ServerEnv) SecretManager Uses

func (s *ServerEnv) SecretManager() secrets.SecretManager

Package serverenv imports 11 packages (graph) and is imported by 13 packages. Updated 2020-09-21. Refresh now. Tools for package owners.