shared

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2016 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MYSQL_DATETIME_LAYOUT = "2006-01-02 15:04:05"
)

Variables

View Source
var (
	ErrNotFound          = errors.New("resource not found")
	ErrNoMetric          = errors.New("metric not found")
	ErrNoData            = errors.New("no data in time range")
	ErrNoService         = errors.New("service not found")
	ErrInvalidService    = errors.New("invalid service")
	ErrNoInstance        = errors.New("instance not found")
	ErrReadOnlyDb        = errors.New("database is read-only")
	ErrDuplicateEntry    = errors.New("duplicate entry")
	ErrGoroutineCrash    = errors.New("goroutine crashed")
	ErrUnexpectedReturn  = errors.New("unexpected return")
	ErrUnauthorized      = errors.New("unauthorized")
	ErrDuplicateAgent    = errors.New("duplicate agent")
	ErrAgentNotConnected = errors.New("agent not connected")
	ErrLinkClosed        = errors.New("link closed")
	ErrNotImplemented    = errors.New("not implemented")
	ErrTimeout           = errors.New("timeout")
	ErrAgentReplyError   = errors.New("agent reply error")
)
View Source
var InternalStats stats.Stats = stats.NewStats(&statsd.NoopClient{}, "", "", "", "0")
View Source
var QueryAbstracter *query.Mini
View Source
var RouteStats stats.Stats = stats.NewStats(&statsd.NoopClient{}, "", "", "", "0")
View Source
var TableParser *query.Mini

Functions

func AtLeastVersion

func AtLeastVersion(v1, v2 string) (bool, error)

func GenericStringList

func GenericStringList(s []string) []interface{}

func IsNetworkError

func IsNetworkError(err error) bool

func Placeholders

func Placeholders(length int) string

func ValidateTimeRange

func ValidateTimeRange(beginTs, endTs string) (time.Time, time.Time, error)

Types

type AgentCommunicator

type AgentCommunicator interface {
	Start() error
	Stop()
	Done() chan bool
	IsAlive() bool
	Send(cmd *proto.Cmd) (*proto.Reply, error)
}

An AgentCommunicator sends proto.Cmd to a agent, handling concurrency and hiding whether the agent is local or remote.

type AgentFinder

type AgentFinder interface {
	Add(agentId uint, comm AgentCommunicator) error
	Remove(agentId uint)
	Get(agentId uint) AgentCommunicator
	Refresh(timeLimit time.Duration)
}

An AgentFinder provides local clients the AgentCommunicator for an agent.

var AgentDirectory AgentFinder

Jump to

Keyboard shortcuts

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