routers

package
v0.405.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseConfig

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

DatabaseConfig loads values a project's configuration from the given database.

func NewDatabaseConfig

func NewDatabaseConfig(db DatabaseConfigDAL) DatabaseConfig

func (DatabaseConfig) Get

func (DatabaseConfig) List

func (DatabaseConfig) Role

func (DatabaseConfig) Set

func (d DatabaseConfig) Set(ctx context.Context, ref configuration.Ref, key *url.URL) error

func (DatabaseConfig) Unset

type DatabaseConfigDAL

type DatabaseConfigDAL interface {
	ListModuleConfiguration(ctx context.Context) ([]dal.ModuleConfiguration, error)
}

type DatabaseSecrets

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

DatabaseSecrets loads values a project's secrets from the given database.

func NewDatabaseSecrets

func NewDatabaseSecrets(db DatabaseSecretsDAL) DatabaseSecrets

func (DatabaseSecrets) Get

func (DatabaseSecrets) List

func (DatabaseSecrets) Role

func (DatabaseSecrets) Set

func (d DatabaseSecrets) Set(ctx context.Context, ref configuration.Ref, key *url.URL) error

func (DatabaseSecrets) Unset

type DatabaseSecretsDAL

type DatabaseSecretsDAL interface {
	GetModuleSecretURL(ctx context.Context, module optional.Option[string], name string) (string, error)
	ListModuleSecrets(ctx context.Context) ([]dal.ModuleSecret, error)
	SetModuleSecretURL(ctx context.Context, module optional.Option[string], name string, url string) error
	UnsetModuleSecret(ctx context.Context, module optional.Option[string], name string) error
}

type FileRouter

type FileRouter[R configuration.Role] struct {
	// contains filtered or unexported fields
}

FileRouter is a simple JSON-file-based router for configuration.

func NewFileRouter

func NewFileRouter[R configuration.Role](path string) *FileRouter[R]

func (*FileRouter[R]) Get

func (f *FileRouter[R]) Get(ctx context.Context, ref configuration.Ref) (key *url.URL, err error)

func (*FileRouter[R]) List

func (f *FileRouter[R]) List(ctx context.Context) ([]configuration.Entry, error)

func (*FileRouter[R]) Role

func (f *FileRouter[R]) Role() (role R)

func (*FileRouter[R]) Set

func (f *FileRouter[R]) Set(ctx context.Context, ref configuration.Ref, key *url.URL) error

func (*FileRouter[R]) Unset

func (f *FileRouter[R]) Unset(ctx context.Context, ref configuration.Ref) error

type ProjectConfig

type ProjectConfig[R configuration.Role] struct {
	Config string `` /* 126-byte string literal not displayed */
}

ProjectConfig is parametric Resolver that loads values from either a project's configuration or secrets maps based on the type parameter.

See the [projectconfig] package for details on the configuration file format.

func (ProjectConfig[R]) Get

func (p ProjectConfig[R]) Get(ctx context.Context, ref configuration.Ref) (*url.URL, error)

func (ProjectConfig[R]) List

func (p ProjectConfig[R]) List(ctx context.Context) ([]configuration.Entry, error)

func (ProjectConfig[R]) Role

func (p ProjectConfig[R]) Role() R

func (ProjectConfig[R]) Set

func (p ProjectConfig[R]) Set(ctx context.Context, ref configuration.Ref, key *url.URL) error

func (ProjectConfig[From]) Unset

func (p ProjectConfig[From]) Unset(ctx context.Context, ref configuration.Ref) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL