Documentation ¶
Index ¶
- Variables
- type ConfDataSourceMysql
- type ConfProxy
- func (cp *ConfProxy) C() <-chan *structs.ConfNode
- func (cp *ConfProxy) Close()
- func (cp *ConfProxy) GetRawValues(ctx echo.Context, rawKey string) (config string, err error)
- func (cp *ConfProxy) GetValues(ctx echo.Context, appName, appEnv, target, port string) (config string, err error)
- func (cp *ConfProxy) ListenAppConfig(ctx echo.Context, appName, appEnv, target, port string, watch bool, ...) (structs.ContentNode, error)
- func (cp *ConfProxy) ListenRawKeyAppConfig(ctx echo.Context, rawKey string, watch bool, internal int) (structs.ContentNode, error)
- func (cp *ConfProxy) Reload() error
- func (cp *ConfProxy) Start()
- type Config
- type DataSource
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfDir = "/home/www/.config/juno-agent"
DefaultConfDir ...
Functions ¶
This section is empty.
Types ¶
type ConfDataSourceMysql ¶
ConfDataSourceMysql mysql dataSource
type ConfProxy ¶
type ConfProxy struct {
// contains filtered or unexported fields
}
ConfProxy confProxy struct
func NewConfProxy ¶
func NewConfProxy(enable bool, confClient DataSource) *ConfProxy
NewConfProxy new instance
func (*ConfProxy) GetRawValues ¶
GetRawValues ...
func (*ConfProxy) GetValues ¶
func (cp *ConfProxy) GetValues(ctx echo.Context, appName, appEnv, target, port string) (config string, err error)
GetValues ...
func (*ConfProxy) ListenAppConfig ¶
func (cp *ConfProxy) ListenAppConfig(ctx echo.Context, appName, appEnv, target, port string, watch bool, internal int) (structs.ContentNode, error)
ListenAppConfig ...
func (*ConfProxy) ListenRawKeyAppConfig ¶
func (cp *ConfProxy) ListenRawKeyAppConfig(ctx echo.Context, rawKey string, watch bool, internal int) (structs.ContentNode, error)
ListenRawKeyAppConfig ...
type Config ¶
type Config struct { Dir string `json:"dir"` // 配置中心具体配置路径 Prefix string `json:"prefix"` Env []string `json:"env"` Timeout time.Duration // etcd连接超时时间 Secure bool Enable bool // 是否开启开插件 Mysql ConfDataSourceMysql `json:"mysql"` }
Config confProxy config
type DataSource ¶
type DataSource interface { ListenAppConfig(ctx echo.Context, key string) chan *structs.ConfNode GetValues(ctx echo.Context, keys ...string) (map[string]string, error) GetRawValues(ctx echo.Context, rawKey string) (map[string]string, error) AppConfigScanner() []*structs.ConfNode Reload() error Stop() }
DataSource confu proxy dataSource interface ...
Click to show internal directories.
Click to hide internal directories.