carbon

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2016 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseConfig

func ParseConfig(filename string, cfg interface{}) error

ParseConfig ...

func PrintConfig

func PrintConfig(cfg interface{}) error

PrintConfig ...

func TestConfig

func TestConfig(rootDir string) string

TestConfig creates config with all files in root directory

Types

type App

type App struct {
	sync.RWMutex
	ConfigFilename string
	Config         *Config
	Cache          *cache.Cache
	UDP            *receiver.UDP
	TCP            *receiver.TCP
	Pickle         *receiver.TCP
	CarbonLink     *cache.CarbonlinkListener
	Persister      *persister.Whisper
	// contains filtered or unexported fields
}

func New

func New(configFilename string) *App

New App instance

func (*App) GraceStop

func (app *App) GraceStop()

GraceStop implements gracefully stop. Close all listening sockets, flush cache, stop application

func (*App) Loop

func (app *App) Loop()

Loop ...

func (*App) ParseConfig

func (app *App) ParseConfig() error

ParseConfig loads config from config file, schemas.conf, aggregation.conf

func (*App) ReloadConfig

func (app *App) ReloadConfig() error

ReloadConfig reloads some settings from config

func (*App) Start

func (app *App) Start() (err error)

Start starts

func (*App) Stop

func (app *App) Stop()

Stop force stop all components

type Config

type Config struct {
	Common     commonConfig     `toml:"common"`
	Whisper    whisperConfig    `toml:"whisper"`
	Cache      cacheConfig      `toml:"cache"`
	Udp        udpConfig        `toml:"udp"`
	Tcp        tcpConfig        `toml:"tcp"`
	Pickle     pickleConfig     `toml:"pickle"`
	Carbonlink carbonlinkConfig `toml:"carbonlink"`
	Pprof      pprofConfig      `toml:"pprof"`
}

Config ...

func NewConfig

func NewConfig() *Config

NewConfig ...

type Duration

type Duration struct {
	time.Duration
}

Duration wrapper time.Duration for TOML

func (*Duration) MarshalText

func (d *Duration) MarshalText() ([]byte, error)

MarshalText encode text with TOML format

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(text []byte) error

UnmarshalText from TOML

func (*Duration) Value

func (d *Duration) Value() time.Duration

Value return time.Duration value

Jump to

Keyboard shortcuts

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