agent

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2013 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComposeRedisAddress

func ComposeRedisAddress(ip string, port string) (address string)

func Debug

func Debug(value ...interface{})

func Fatal

func Fatal(value ...interface{})

func GetSentinel

func GetSentinel() (sentinel string)

func LoadTwemproxyConfig

func LoadTwemproxyConfig()

func Log

func Log(value ...interface{})

func ReadYaml

func ReadYaml(path string, obj interface{}) error

func RestartTwemproxy

func RestartTwemproxy() error

func Run

func Run()

func SaveTwemproxyConfig

func SaveTwemproxyConfig()

func SetFileLogger

func SetFileLogger()

func SubscribeToSentinel

func SubscribeToSentinel()

func SwitchMaster

func SwitchMaster(master_name string, ip string, port string) error

func UpdateMaster

func UpdateMaster(master_name string, ip string, port string) bool

func ValidateCurrentMaster

func ValidateCurrentMaster() error

func ValidateSettings

func ValidateSettings()

func WriteYaml

func WriteYaml(path string, obj interface{}) error

Types

type AgentSettings

type AgentSettings struct {
	AgentConfigFile     string
	Verbose             bool
	TwemproxyPoolName   string `yaml:"twemproxy_pool_name"`
	TwemproxyConfigFile string `yaml:"twemproxy_config_file"`
	SentinelIp          string `yaml:"sentinel_ip"`
	SentinelPort        string `yaml:"sentinel_port"`
	RestartCommand      string `yaml:"restart_command"`
	LogFile             string `yaml:"log_file"`
}
var Settings AgentSettings = AgentSettings{}

type TwemproxyConfig

type TwemproxyConfig struct {
	Listen       string   `yaml:"listen,omitempty"`
	Hash         string   `yaml:"hash,omitempty"`
	Distribution string   `yaml:"distribution,omitempty"`
	Redis        bool     `yaml:"redis,omitempty"`
	RetryTimeout int      `yaml:"server_retry_timeout,omitempty"`
	FailureLimit int      `yaml:"server_failure_limit,omitempty"`
	Servers      []string `yaml:"servers,omitempty"`
}

Jump to

Keyboard shortcuts

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