config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2015 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FILE     Strategy = "file"
	ETCD              = "etcd"
	REGISTRY          = "registry"
)
View Source
const (
	VERSION = "v0.0.1"
)

Variables

View Source
var (
	LOG_DIR              = ""
	LOG_FILE             = "hickwall.log"
	LOG_FILEPATH         = ""
	SHARED_DIR           = ""
	CORE_CONF_FILEPATH   = ""
	CONF_FILEPATH        = ""
	CONF_GROUP_DIRECTORY = ""
	REGISTRY_FILEPATH    = ""
)
View Source
var (
	ERR_REGISTRY_REVOKED = errors.New("registry has been revoked!")
)
View Source
var (
	ETCD_URL_PAT = regexp.MustCompile(`^http[s]?://.*(:\d+)?[/]?`)
)

Functions

func IsCoreConfigLoaded added in v0.2.0

func IsCoreConfigLoaded() bool

func IsRegistryFileExists added in v0.2.0

func IsRegistryFileExists() bool

func LoadCoreConfig added in v0.2.0

func LoadCoreConfig() error

func WatchRuntimeConfFromEtcd added in v0.1.1

func WatchRuntimeConfFromEtcd(stop chan error) <-chan RespConfig

Types

type ClientConfig added in v0.2.0

type ClientConfig struct {
	HeartBeat_Interval string            `json:"heartbeat_interval"`
	Tags               map[string]string `json:"tags"`
	Hostname           string            `json:"hostname"`
	Metric_Enabled     bool              `json:"metric_enabled"`
	Metric_Interval    string            `json:"metric_interval"`

	Transport_dummy    *Transport_dummy                   `json:"transport_dummy"` // for testing purpose
	Transport_file     *b_conf.Transport_file             `json:"transport_file"`
	Transport_influxdb []*b_conf.Transport_influxdb       `json:"transport_influxdb"`
	Transport_kafka    *b_conf.Transport_kafka            `json:"transport_kafka"`
	Subscribe_kafka    []*c_conf.Config_KafkaSubscription `json:"subscribe_kafka"` // subscribe kafka
}

type CollectorConfigGroup added in v0.2.0

type CollectorConfigGroup struct {
	Prefix         string               `json:"prefix"`
	Collector_ping []c_conf.Config_Ping `json:"collector_ping"`
}

type CoreConfig added in v0.1.1

type CoreConfig struct {
	Log_level         string   `json:"log_level"`         // possible values: trace, debug, info, warn, error, critical
	Log_file_maxsize  int      `json:"log_file_maxsize"`  // TODO: log_file_maxsize
	Log_file_maxrolls int      `json:"log_file_maxrolls"` // TODO: log_file_maxrolls
	Config_Strategy   Strategy `json:"config_strategy"`   // possible values:  file, etcd, registry
	Etcd_url          string   `json:"etcd_url"`          // etcd config
	Etcd_path         string   `json:"etcd_path"`
	Registry_Server   string   `json:"registry_server"` // registry server config
}
var (
	CoreConf CoreConfig // only file

)

public variables ---------------------------------------------------------------

type RegistryInfo added in v0.2.0

type RegistryInfo struct {
	Etcd_registry_endpoint string `json:"etcd_registry_endpoint"`
	Etcd_config_endpoing   string `json:"etcd_config_endpoint"`
	Etcd_url               string `json:"etcd_url"`
	Cookie                 string `json:"cookie"`
}

func ReadRegistryFile added in v0.2.0

func ReadRegistryFile() (*RegistryInfo, error)

func Registry added in v0.2.0

func Registry(reg_url string) (*RegistryInfo, error)

type RespConfig added in v0.1.1

type RespConfig struct {
	Config RuntimeConfig
	Err    error
}

type RuntimeConfig added in v0.1.1

type RuntimeConfig struct {
	Client ClientConfig           `json:"client"`
	Groups []CollectorConfigGroup `json:"groups"`
}

func LoadRuntimeConfigFromFiles added in v0.2.0

func LoadRuntimeConfigFromFiles() (rc RuntimeConfig, err error)

func ReadRuntimeConfig added in v0.2.0

func ReadRuntimeConfig(r io.Reader) (rc RuntimeConfig, err error)

type Strategy added in v0.2.0

type Strategy string

func (*Strategy) GetString added in v0.2.0

func (s *Strategy) GetString() string

func (*Strategy) IsValid added in v0.2.0

func (s *Strategy) IsValid() bool

type Transport_dummy added in v0.2.0

type Transport_dummy struct {
	Name      string
	Jamming   newcore.Interval
	Printting bool
	Detail    bool
}

Jump to

Keyboard shortcuts

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