routers

package
v0.411.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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

Jump to

Keyboard shortcuts

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