Documentation ¶
Index ¶
- type FileRouter
- func (f *FileRouter[R]) Get(ctx context.Context, ref configuration.Ref) (key *url.URL, err error)
- func (f *FileRouter[R]) List(ctx context.Context) ([]configuration.Entry, error)
- func (f *FileRouter[R]) Role() (role R)
- func (f *FileRouter[R]) Set(ctx context.Context, ref configuration.Ref, key *url.URL) error
- func (f *FileRouter[R]) Unset(ctx context.Context, ref configuration.Ref) error
- type ProjectConfig
- func (p ProjectConfig[R]) Get(ctx context.Context, ref configuration.Ref) (*url.URL, error)
- func (p ProjectConfig[R]) List(ctx context.Context) ([]configuration.Entry, error)
- func (p ProjectConfig[R]) Role() R
- func (p ProjectConfig[R]) Set(ctx context.Context, ref configuration.Ref, key *url.URL) error
- func (p ProjectConfig[From]) Unset(ctx context.Context, ref configuration.Ref) error
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
Click to show internal directories.
Click to hide internal directories.