Documentation
¶
Index ¶
- type Loader
- func (l *Loader) Client() *api.Client
- func (l *Loader) Delete(ctx context.Context, key string) error
- func (l *Loader) DynamicValue(ctx context.Context, wg *sync.WaitGroup, key string) (<-chan []byte, func(), error)
- func (l *Loader) Load(ctx context.Context, key string) ([]byte, error)
- func (l *Loader) LoadChu(ctx context.Context, to any, opts ...loader.Option) error
- func (l *Loader) Set(ctx context.Context, key string, value []byte) error
- func (l *Loader) SetClient(c *api.Client)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Loader ¶
type Loader struct {
QueryOptions api.QueryOptions
WriteOptions api.WriteOptions
// Decode for consul file to interface{}
// - default is yaml decoder
Decode func(r io.Reader, to interface{}) error
// contains filtered or unexported fields
}
func (*Loader) DynamicValue ¶
func (l *Loader) DynamicValue(ctx context.Context, wg *sync.WaitGroup, key string) (<-chan []byte, func(), error)
DynamicValue return a channel for getting latest value of key. This function will start a goroutine for watching key. The caller should call stop function when it is no longer needed.
Click to show internal directories.
Click to hide internal directories.