代码拉取完成,页面将自动刷新
// package loader manages loading from multiple sources
package loader
import (
"context"
"gitee.com/sansaniot/sansan-core/config/reader"
"gitee.com/sansaniot/sansan-core/config/source"
)
// Loader manages loading sources
type Loader interface {
// Close Stop the loader
Close() error
// Load the sources
Load(...source.Source) error
// Snapshot A Snapshot of loaded config
Snapshot() (*Snapshot, error)
// Sync Force sync of sources
Sync() error
// Watch for changes
Watch(...string) (Watcher, error)
// String Name of loader
String() string
}
// Watcher lets you watch sources and returns a merged ChangeSet
type Watcher interface {
// Next First call to next may return the current Snapshot
// If you are watching a path then only the data from
// that path is returned.
Next() (*Snapshot, error)
// Stop watching for changes
Stop() error
}
// Snapshot is a merged ChangeSet
type Snapshot struct {
// The merged ChangeSet
ChangeSet *source.ChangeSet
// Version Deterministic and comparable version of the snapshot
Version string
}
type Options struct {
Reader reader.Reader
Source []source.Source
// for alternative data
Context context.Context
}
type Option func(o *Options)
// Copy snapshot
func Copy(s *Snapshot) *Snapshot {
cs := *(s.ChangeSet)
return &Snapshot{
ChangeSet: &cs,
Version: s.Version,
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。