Documentation ¶
Index ¶
- Constants
- Variables
- func GetDockerClient() *docker.Client
- func Init(persist bool, pub push.Pusher)
- func NewContainerRecord(iden string)
- func ParseDuration(s string, df time.Duration) time.Duration
- func Place(service *Service)
- func Register(service *Service)
- func Suspend(iden string)
- func Unregister(iden string)
- func Validate(iden, srv, port string, network []docker.APIPort) bool
- type Alloc
- type Fail
- type RunningRecord
- type Service
Constants ¶
View Source
const ( UpkeepTimeout = 3 * time.Second ProbeTimeout = 1 * time.Second MaxFailAttemps = 3 )
View Source
const ( ServiceUp = "up" 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 (
Advertise string
)
View Source
var (
ErrNoSuchDriver = errors.New("no such driver")
)
Functions ¶
func GetDockerClient ¶
func NewContainerRecord ¶
func NewContainerRecord(iden string)
func Unregister ¶
func Unregister(iden string)
Types ¶
type Alloc ¶
func AllocHelper ¶
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"` }
Click to show internal directories.
Click to hide internal directories.