config

package
v0.0.0-...-1c22944 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

func NewBuilder

func NewBuilder(inputOption InputOption, out any) (*Builder, error)

func (*Builder) Load

func (b *Builder) Load() error

func (*Builder) OnLoad

func (b *Builder) OnLoad(f func(any))

func (*Builder) Watch

func (b *Builder) Watch() error

type Content

type Content struct {
	Body    []byte
	ModTime time.Time
}

type InputOption

type InputOption struct {
	Path         string
	PollInterval time.Duration
}

func (InputOption) NewInputer

func (o InputOption) NewInputer() (Inputer, error)

type Inputer

type Inputer interface {
	Read() (Content, error)
	Watch(func(Inputer)) error
	Close()
}

func NewLocalFileInput

func NewLocalFileInput(option InputOption) (Inputer, error)

func NewRemoteFileInput

func NewRemoteFileInput(option InputOption) (Inputer, error)

type LocalFileInput

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

func (*LocalFileInput) Close

func (i *LocalFileInput) Close()

func (*LocalFileInput) Read

func (i *LocalFileInput) Read() (Content, error)

func (*LocalFileInput) Watch

func (i *LocalFileInput) Watch(cb func(Inputer)) error

type RemoteFileInput

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

func (*RemoteFileInput) Close

func (i *RemoteFileInput) Close()

func (*RemoteFileInput) ParseModTime

func (i *RemoteFileInput) ParseModTime(resp *http.Response) time.Time

func (*RemoteFileInput) Read

func (i *RemoteFileInput) Read() (Content, error)

func (*RemoteFileInput) Watch

func (i *RemoteFileInput) Watch(cb func(Inputer)) error

Jump to

Keyboard shortcuts

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