consulloader

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...Option) func() loader.Loader

Types

type Loader

type Loader struct {
	QueryOptions api.QueryOptions
	WriteOptions api.WriteOptions

	// Decode for consul file to any
	//  - default is yaml decoder
	Decode func(r io.Reader, to any) error
	// contains filtered or unexported fields
}

func (*Loader) Client

func (l *Loader) Client() *api.Client

func (*Loader) Load

func (l *Loader) Load(ctx context.Context, key string) ([]byte, error)

func (*Loader) LoadChu

func (l *Loader) LoadChu(ctx context.Context, to any, opt *loader.Option) error

func (*Loader) SetClient

func (l *Loader) SetClient(c *api.Client)

type Option

type Option func(*option)

func WithDecode

func WithDecode(d func(r io.Reader, to any) error) Option

WithDecode sets the decoder for the consul loader.

  • default is yaml decoder

Jump to

Keyboard shortcuts

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