core

package
v2.6.4 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "file"

Name is the name of the file config source.

Variables

This section is empty.

Functions

This section is empty.

Types

type Source

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

Source is a file-based config source.

func NewSource

func NewSource(path string, mode config.Mode) *Source

NewSource returns a file-based config source rooted at path with the given mode.

func (*Source) Close added in v2.1.0

func (s *Source) Close() error

Close closes the source.

func (*Source) Load

func (s *Source) Load(ctx context.Context, file ...string) ([]*config.Configuration, error)

Load loads the configurations of the given files, or every file under the source path when file is empty.

func (*Source) Name

func (s *Source) Name() string

Name returns the name of the source.

func (*Source) Store

func (s *Source) Store(ctx context.Context, file string, content []byte) error

Store saves content as file under the source path.

func (*Source) Watch

func (s *Source) Watch(ctx context.Context) (config.Watcher, error)

Watch starts watching the source path and returns a config.Watcher.

Jump to

Keyboard shortcuts

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