config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2016 License: BSD-3-Clause Imports: 9 Imported by: 6

Documentation

Index

Constants

View Source
const VERSION = "0.1.0"

VERSION sets the agent version here.

Variables

View Source
var (
	// DefaultConfig is the default top-level configuration.
	DefaultConfig = Config{
		GlobalConfig: DefaultGlobalConfig,
	}

	// DefaultGlobalConfig is the default global configuration.
	DefaultGlobalConfig = GlobalConfig{
		CiURL:      "https://dc-cloud.oneapm.com",
		BindHost:   "127.0.0.1",
		ListenPort: 10010,
		StatsdPort: 8251,
	}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	GlobalConfig  GlobalConfig  `toml:"global"`
	LoggingConfig LoggingConfig `toml:"logging"`
	Plugins       []*plugin.RunningPlugin
}

Config represents cloudinsight-agent's configuration file.

func NewConfig

func NewConfig(confPath string) (*Config, error)

NewConfig creates a new instance of Config.

func (*Config) GetForwarderAddr

func (c *Config) GetForwarderAddr() string

GetForwarderAddr gets the address that Forwarder listening to.

func (*Config) GetForwarderAddrWithScheme

func (c *Config) GetForwarderAddrWithScheme() string

GetForwarderAddrWithScheme gets the address of Forwarder with scheme prefix.

func (*Config) GetHostname

func (c *Config) GetHostname() string

GetHostname gets the hostname from os itself if not set in the agent configuration.

func (*Config) GetStatsdAddr

func (c *Config) GetStatsdAddr() string

GetStatsdAddr gets the address that Statsd listening to.

func (*Config) InitializeLogging

func (c *Config) InitializeLogging() error

InitializeLogging initializes logging level and output according to the agent configuration.

func (*Config) LoadConfig

func (c *Config) LoadConfig(confPath string) error

LoadConfig XXX

func (*Config) PluginNames

func (c *Config) PluginNames() []string

PluginNames returns a list of strings of the configured Plugins.

type GlobalConfig

type GlobalConfig struct {
	CiURL      string `toml:"ci_url"`
	LicenseKey string `toml:"license_key"`
	Hostname   string `toml:"hostname"`
	Tags       string `toml:"tags"`
	BindHost   string `toml:"bind_host"`
	ListenPort int    `toml:"listen_port"`
	StatsdPort int    `toml:"statsd_port"`
}

GlobalConfig XXX

type LoggingConfig

type LoggingConfig struct {
	LogLevel string `toml:"log_level"`
	LogFile  string `toml:"log_file"`
}

LoggingConfig XXX

Jump to

Keyboard shortcuts

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