state

package
v0.0.0-...-7cb0e1f Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Periodic check state -> etcd dumper

Index

Constants

View Source
const (
	STATE_PREFIX         = "state"
	DEFAULT_STATE_TTL    = time.Hour * 24
	STATE_TTL_MULTIPLIER = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Check   string          `json:"check"`
	Owner   string          `json:"owner"`
	Status  string          `json:"status"`
	Count   int             `json:"count"`
	Message string          `json:"message"`
	Date    time.Time       `json:"date"`
	Config  json.RawMessage `json:"config"`
}

type State

type State struct {
	Config       *config.Config
	Log          log.FieldLogger
	StateChannel chan *Message
	Mutex        *sync.Mutex
	Data         map[string]*Message
	DumperLooper director.Looper

	base.Component
}

func New

func New(cfg *config.Config, stateChannel chan *Message) *State

func (*State) Start

func (s *State) Start() error

func (*State) Stop

func (s *State) Stop() error

type TmpMonitorConfig

type TmpMonitorConfig struct {
	Interval util.CustomDuration `json:"interval"`
}

Used for parsing/fetching the interval from a config in a state message

Jump to

Keyboard shortcuts

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