Documentation ¶
Index ¶
- func AccessConnMode() uint8
- func AccessConsulAddr() string
- func AccessFailRetryIntervalS() int
- func AccessHostTryTimes() int
- func AccessMaxFailsPeriodS() int
- func AccessMaxHostRetry() int
- func AccessMaxPartRetry() int
- func AccessMaxSizePutOnce() int64
- func AccessPriorityAddrs() []string
- func AccessServiceIntervalS() int
- func All() map[string]interface{}
- func Cluster() *cmapi.Client
- func ClusterMgrSecret() string
- func Clusters() (clusters map[string][]string)
- func DefaultClusterID() int
- func Del(key string)
- func Get(key string) interface{}
- func LoadConfig(path string)
- func NewCluster(clusterID string, hosts []string, secret string) *cmapi.Client
- func NewConsulClient(addr string) (*api.Client, error)
- func PrintType()
- func Region() string
- func Set(key string, value interface{})
- func SetFrom(key, value string)
- func Verbose() bool
- func Vverbose() bool
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessConnMode ¶
func AccessConnMode() uint8
func AccessConsulAddr ¶
func AccessConsulAddr() string
func AccessFailRetryIntervalS ¶
func AccessFailRetryIntervalS() int
func AccessHostTryTimes ¶
func AccessHostTryTimes() int
func AccessMaxFailsPeriodS ¶
func AccessMaxFailsPeriodS() int
func AccessMaxHostRetry ¶
func AccessMaxHostRetry() int
func AccessMaxPartRetry ¶
func AccessMaxPartRetry() int
func AccessMaxSizePutOnce ¶
func AccessMaxSizePutOnce() int64
func AccessPriorityAddrs ¶
func AccessPriorityAddrs() []string
func AccessServiceIntervalS ¶
func AccessServiceIntervalS() int
func ClusterMgrSecret ¶
func ClusterMgrSecret() string
func DefaultClusterID ¶
func DefaultClusterID() int
func NewCluster ¶
NewCluster returns cluster client. TODO: returns cached cluster with the same params.
func NewConsulClient ¶
NewConsulClient returns client of consul with address.
Types ¶
type Config ¶
type Config struct { Region string `json:"region" cache:"Key-Region" help:"region to choose cluster"` DefaultClusterID int `json:"default_cluster_id" cache:"Key-DefaultClusterID" help:"ID to choose default cluster"` Verbose bool `json:"verbose" cache:"Flag-Verbose" help:"enable verbose mode"` Vverbose bool `json:"vverbose" cache:"Flag-Vverbose" help:"enable verbose verbose mode"` ClusterMgrCluster map[string]string `json:"cm_cluster" cache:"Key-ClusterMgrCluster" help:"cluster manager addrs"` ClusterMgrSecret string `json:"cm_secret" cache:"Key-ClusterMgrSecret" help:"cluster manager secret"` Access struct { ConnMode uint8 `json:"conn_mode" cache:"Key-Access-ConnMode" help:"connection mode, 4 means no timeout"` ConsulAddr string `json:"consul_addr" cache:"Key-Access-ConsulAddr" help:"consul address"` ServiceIntervalS int `json:"service_interval_s" cache:"Key-Access-ServiceIntervalS" help:"service interval second"` PriorityAddrs []string `json:"priority_addrs" cache:"Key-Access-PriorityAddrs" help:"priority addresses to try"` MaxSizePutOnce int64 `json:"max_size_put_once" cache:"Key-Access-MaxSizePutOnce" help:"max size put once"` MaxPartRetry int `json:"max_part_retry" cache:"Key-Access-MaxPartRetry" help:"max times to retry part"` MaxHostRetry int `json:"max_host_retry" cache:"Key-Access-MaxHostRetry" help:"max times to retry host"` FailRetryIntervalS int `json:"fail_retry_interval_s" cache:"Key-Access-FailRetryIntervalS" help:"interval for the failed host to retry"` MaxFailsPeriodS int `` /* 136-byte string literal not displayed */ HostTryTimes int `json:"host_try_times" cache:"Key-Access-HostTryTimes" help:"number of host failure retries"` } `json:"access"` }
Config config in file
Click to show internal directories.
Click to hide internal directories.