param

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultRemoteEndpoints = []string{"http://127.0.0.1:2379"}
)

Functions

This section is empty.

Types

type Cli

type Cli struct {
	Content []byte // 如果用WithConfigContent指定了配置内容,则这里不为空
}

func NewCliDefaultParam

func NewCliDefaultParam() *Cli

type Env

type Env struct {
	Prefix string // 环境变量前缀
}

func NewEnvDefaultParam

func NewEnvDefaultParam() *Env

type File

type File struct {
	FileConfigType string   // 配置内容类型,e,g: toml, json
	RootDirs       []string // 配置文件所在的RootDirs
	File           string   // 指定的配置文件
	SearchDirs     []string // 未指定配置文件情况下,搜索的目录
	SearchFileName string   // 未指定配置文件情况下,搜索的文件名,不需要文件后缀
}

func NewFileDefaultParam

func NewFileDefaultParam() *File

type Param

type Param struct {
	*File
	*Env
	*Remote
	*Cli
	DefaultRemoteWatcher func() // 默认的远程配置监听函数,从SDK传入
}

func GetDefaultParam

func GetDefaultParam() *Param

type Remote

type Remote struct {
	Provider         string
	Endpoints        []string
	Secret           string
	RemoteConfigType string
	WatchInterval    int // 单位:秒
	WatchPath        string
	WatchCallback    func()
}

func NewRemoteDefaultParam

func NewRemoteDefaultParam() *Remote

Jump to

Keyboard shortcuts

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