option

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindKeyedOptionPath

func BindKeyedOptionPath[T any](repo *Repository, key string, path string)

func BindKeyedOptionValue

func BindKeyedOptionValue[T any](repo *Repository, key string, value T)

func BindOptionPath

func BindOptionPath[T any](repo *Repository, path string)

func BindOptionValue

func BindOptionValue[T any](repo *Repository, value T)

Types

type IOptionInjector

type IOptionInjector interface {
	// contains filtered or unexported methods
}

type Option

type Option[T any] struct {
	// contains filtered or unexported fields
}

func (*Option[T]) Get

func (ss *Option[T]) Get() T

func (*Option[T]) GetKeyed

func (ss *Option[T]) GetKeyed(key string) T

func (*Option[T]) OnChanged added in v0.0.14

func (ss *Option[T]) OnChanged(cb func())

func (*Option[T]) OnKeyedChanged added in v0.0.14

func (ss *Option[T]) OnKeyedChanged(key string, cb func())

type Repository

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

func NewOptionRepository

func NewOptionRepository(config configuration.IConfiguration) *Repository

func (*Repository) BindByPath

func (ss *Repository) BindByPath(key string, ty reflect.Type, path string)

func (*Repository) BindByValue

func (ss *Repository) BindByValue(key string, ty reflect.Type, value any)

func (*Repository) GetOptionWrapper added in v0.0.14

func (ss *Repository) GetOptionWrapper(ty reflect.Type) any

Jump to

Keyboard shortcuts

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