upkeep

package
v0.0.0-...-01d1613 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2015 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UpkeepTimeout = 3 * time.Second

	ProbeTimeout = 1 * time.Second

	MaxFailAttemps = 3
)
View Source
const (
	ServiceUp          = "up"
	ServiceUnavailable = "unavailable"
	ServiceDown        = "down"
	ServiceRemoved     = "die"
)
View Source
const (
	DEFAULT_SYNC_PATH  = "/tmp"
	DEFAULT_SYNC_CYCLE = 2 * time.Minute
)
View Source
const (
	DEFAULT_HEARTBEAT = 30 * time.Second
	DEFAULT_TTL       = 45 * time.Second

	DEFAULT_PROBE = 5 * time.Second
)
View Source
const (
	DefaultAmbassador = "http://ambassador:29091/proxy"
)

Variables

View Source
var (
	RootContext ctx.Context
	ResetAll    ctx.CancelFunc

	Record = make(map[string]*RunningRecord)
)
View Source
var (
)
View Source
var (
	ErrNoSuchDriver = errors.New("no such driver")
)

Functions

func GetDockerClient

func GetDockerClient() *docker.Client

func Init

func Init(persist bool, pub push.Pusher)

func NewContainerRecord

func NewContainerRecord(iden string)

func ParseDuration

func ParseDuration(s string, df time.Duration) time.Duration

func Place

func Place(service *Service)

func Register

func Register(service *Service)

func Suspend

func Suspend(iden string)

func Unregister

func Unregister(iden string)

func Validate

func Validate(iden, srv, port string, network []docker.APIPort) bool

Types

type Alloc

type Alloc func(string) (dri.Driver, error)

func AllocHelper

func AllocHelper(ptype string) Alloc

type Fail

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

func NewFail

func NewFail(threshold uint64) *Fail

func (*Fail) Bad

func (f *Fail) Bad() uint64

func (*Fail) Good

func (f *Fail) Good() uint64

func (*Fail) Pass

func (f *Fail) Pass() (ok bool)

type RunningRecord

type RunningRecord struct {
	Srv   string
	Abort ctx.CancelFunc
}

type Service

type Service struct {
	State string `json:"State"`

	Hb  time.Duration `json: "Heartbeat"`
	TTL time.Duration `json: "TTL"`

	PHb           time.Duration `json: "ProbeHeartbeat"`
	ProbeType     string        `json: "ProbeType"`
	ProbeEndpoint string        `json: "ProbeEndpoint"`

	Id       string           `json: "ContainerID"`
	Srv      string           `json: "Service"`
	Port     string           `json: "Port"`
	Net      []docker.APIPort `json: "Net"`
	Proxy    []pxy.Info       `json: "Proxy"`
	ProxyCfg string           `json: "ProxyCfg"`

	Key []string `json: "Key"`
}

func Get

func Get(iden string) (s *Service)

Directories

Path Synopsis
web

Jump to

Keyboard shortcuts

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