file

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSource

func NewSource(path string) config.Source

NewSource 创建一个基于文件的配置源

Types

type Source

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

Source 是基于文件的配置源

func (*Source) Load

func (s *Source) Load() ([]*config.KeyValue, error)

Load 加载文件配置

func (*Source) Watch

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

Watch 监视配置文件变化

type Watcher

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

Watcher 是文件配置监视器

func (*Watcher) Next

func (w *Watcher) Next() ([]*config.KeyValue, error)

Next 阻塞直到接收到文件变化或上下文被取消

func (*Watcher) Stop

func (w *Watcher) Stop() error

Stop 停止监视

Jump to

Keyboard shortcuts

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