Documentation ¶
Index ¶
Constants ¶
View Source
const (
Env = "env"
)
View Source
const File = "file"
View Source
const Flag = "flag"
Variables ¶
This section is empty.
Functions ¶
func RegisterClient ¶
func RegisterClient(name string, constructor Constructor) error
Types ¶
type ChangedCallback ¶
type ChangedCallback func(data []byte)
type Client ¶
type Client interface { io.Closer Pull(ctx context.Context, path string) (data []byte, err error) Push(ctx context.Context, path string, data []byte) error Watch(path string, cb ChangedCallback) error }
Client client interface of baseSource
type Config ¶
type Config struct { // env Flags map[string]interface{} `json:"-"` FlagSet *flag.FlagSet `json:"-"` // common Timeout time.Duration `json:"timeout,omitempty" yaml:"timeout"` WatchTimeout time.Duration `json:"watchTimeout,omitempty" yaml:"watchTimeout"` WatchDisabled bool `json:"watchDisabled,omitempty" yaml:"watchDisabled"` LogDir string `json:"logDir,omitempty" yaml:"logDir"` CacheDir string `json:"cacheDir,omitempty" yaml:"cacheDir"` // remote Endpoint string `json:"endpoint,omitempty" yaml:"endpoint"` Address string `json:"address,omitempty" yaml:"address"` AppID string `json:"appId,omitempty" yaml:"appId"` Cluster string `json:"cluster,omitempty" yaml:"cluster"` RegionID string `json:"regionId,omitempty" yaml:"regionId"` Extra map[string]interface{} `json:"extra,omitempty" yaml:"extra"` // ssl SSLEnabled bool `json:"sslEnabled,omitempty" yaml:"sslEnabled"` SSLCACert string `json:"sslCACert,omitempty" yaml:"sslCACert"` SSLCert string `json:"sslCert,omitempty" yaml:"sslCert"` SSLKey string `json:"sslKey,omitempty" yaml:"sslKey"` SSLVerifyPeer bool `json:"sslVerifyPeer,omitempty" yaml:"sslVerifyPeer"` ServerName string `json:"serverName,omitempty" yaml:"serverName"` // auth Username string `json:"username,omitempty" yaml:"username"` Password string `json:"password,omitempty" yaml:"password"` AccessKey string `json:"accessKey,omitempty" yaml:"accessKey"` SecretKey string `json:"secretKey,omitempty" yaml:"secretKey"` Token string `json:"token,omitempty" yaml:"token"` DataCenter string `json:"dataCenter,omitempty" yaml:"dataCenter"` Namespace string `json:"namespace,omitempty" yaml:"namespace"` Group string `json:"group,omitempty" yaml:"group"` }
Config client configurations
func DefaultConfig ¶
func DefaultConfig() *Config
type Constructor ¶
Click to show internal directories.
Click to hide internal directories.