Documentation
¶
Index ¶
- func GetDockerHostIp() (string, error)
- func InsideDocker() bool
- func LocalIP() (string, error)
- func LocalIPMust() string
- func MarkRunning(name string)
- func NewNatsClient(retries int) *nats.EncodedConn
- func NewRedisClient(addr, password string, database int64) (*redis.Client, error)
- func NewRedisClientMust(addr, password string, database int64) *redis.Client
- func NewRedisClientRetry(addr, password string, database, retries int64) (*redis.Client, error)
- func NodeIP() (string, error)
- func NodeIPMust() string
- type ClusterConfig
- type Config
- type NodeConfig
- type NodeInfo
- type RunningConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDockerHostIp ¶
func InsideDocker ¶
func InsideDocker() bool
InsideDocker returns true if the process is run in a docker container.
func LocalIPMust ¶
func LocalIPMust() string
func MarkRunning ¶
func MarkRunning(name string)
MarkRunning marks the current process, identified by name `name`, as "running" for kato-status.
func NewNatsClient ¶
func NewNatsClient(retries int) *nats.EncodedConn
NewNatsClient connects to the NATS server of the Stackato cluster
func NewRedisClient ¶
NewRedisClient connects to redis after ensuring that the server is indeed running.
func NewRedisClientMust ¶
func NewRedisClientRetry ¶
func NodeIP ¶
NodeIP returns the externally visible address of the docker host. If the current process is not running in a docker container, returns LocalIP()
func NodeIPMust ¶
func NodeIPMust() string
Types ¶
type ClusterConfig ¶
func GetClusterConfig ¶
func GetClusterConfig() *ClusterConfig
func (ClusterConfig) CurrentNodeId ¶
func (c ClusterConfig) CurrentNodeId() (string, error)
func (*ClusterConfig) GetMbusIP ¶
func (c *ClusterConfig) GetMbusIP() string
GetMbusIP returns a docker-friendly value for MbusIP
func (*ClusterConfig) IsMicro ¶
func (c *ClusterConfig) IsMicro() bool
IsMicro returns true if the cluster is configured as a micro cloud.
type Config ¶
Config refers to Stackato configuration under a specific group, such as "dea" or "cluster".
func (*Config) GetChangesChannel ¶
GetChangesChannel returns a channel of (always) nil values that updates upon config changes.
type NodeConfig ¶
NodeConfig corresponds to Kato's /node config, which is a hash of ipaddr => NodeInfo
func GetNodeConfig ¶
func GetNodeConfig() *NodeConfig
type RunningConfig ¶
type RunningConfig map[string]runningInfo
RunningConfig corresponds to Kato's /running config, which is a hash of ipaddr => runningInfo
func GetRunningConfig ¶
func GetRunningConfig() *RunningConfig