core

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReconnectSleepTime = 10 * time.Second
)
View Source
const (
	RedisStatsQueue = "agent.stats"
)
View Source
const (
	ReturnExpire = 300
)

Variables

This section is empty.

Functions

func StartSinks

func StartSinks(mgr *pm.PM, sinks map[string]SinkClient)

StartSinks starts the long polling routines and feed the manager with received commands

Types

type Local

type Local struct {
	// contains filtered or unexported fields
}

func NewLocal

func NewLocal(s string) (*Local, error)

func (*Local) Serve

func (l *Local) Serve()

type LocalCmd

type LocalCmd struct {
	Sync    bool            `json:"sync"`
	Content json.RawMessage `json:"content"`
}

type LocalResult

type LocalResult struct {
	State  string          `json:"state"`
	Error  string          `json:"error,omitempty"`
	Result *core.JobResult `json:"result,omitempty"`
}

type Sink

type Sink interface {
	Run()
}

func NewSink

func NewSink(key string, mgr *pm.PM, client SinkClient) Sink

type SinkClient

type SinkClient interface {
	GetNext(command *core.Command) error
	Respond(result *core.JobResult) error
}

func NewSinkClient

func NewSinkClient(cfg *settings.SinkConfig, id string, responseQueue ...string) (SinkClient, error)

NewSinkClient gets a new sink connection with the given identity. Identity is used by the sink client to introduce itself to the sink terminal.

type StatsFlusher

type StatsFlusher interface {
	Handler(stats *stats.Stats)
}

StatsBuffer implements a buffering and flushing mechanism to buffer statsd messages that are collected via the process manager. Flush happens when buffer is full or a certain time passes since last flush.

The StatsBuffer.Handler should be registers as StatsFlushHandler on the process manager object.

func NewRedisStatsBuffer

func NewRedisStatsBuffer(address string, password string, capacity int, flushInt time.Duration) StatsFlusher

Directories

Path Synopsis
pm

Jump to

Keyboard shortcuts

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