Documentation ¶
Index ¶
- func NodeClose()
- func NodeRegister(options *NodeRegisterOptions) error
- func ParseHTTPResponseError(response *httpx.HttpResponse) string
- type BindConfig
- type CreateContainerResponse
- type CreateOption
- type CreatedContainer
- type CreatedContainers
- type EngineContainer
- type GroupContainer
- type GroupContainers
- type Node
- type NodeCache
- type NodeClusterOptions
- type NodeData
- type NodeOptions
- type NodeRegisterOptions
- type OperatedContainer
- type OperatedContainers
- type Placement
- type Platform
- type Preference
- type RemovedContainer
- type RemovedContainers
- type ResponseError
- type Spread
- type UpdateOption
- type UpgradeContainer
- type UpgradeContainerResponse
- type UpgradeContainers
- type WebHook
- type WebHooks
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NodeRegister ¶
func NodeRegister(options *NodeRegisterOptions) error
NodeRegister is exported register to cluster discovery
func ParseHTTPResponseError ¶
func ParseHTTPResponseError(response *httpx.HttpResponse) string
ParseHTTPResponseError is exported
Types ¶
type BindConfig ¶
type BindConfig struct { Category string `json:"Category"` OwnerToken string `json:"OwnerToken"` Sandbox bool `json:"Sandbox"` Location string `json:"Location"` Protocol string `json:"Protocol"` Port int `json:"Port"` Health string `json:"Health"` APIIDs []string `json:"APIIDs"` }
BindConfig is exported
type CreateContainerResponse ¶
type CreateContainerResponse struct { ID string `json:"Id"` Name string `json:"Name"` Warnings []string `json:"Warnings"` }
CreateContainerResponse is exported
type CreateOption ¶
type CreateOption struct { IsReCreate bool `json:"IsReCreate"` ForceRemove bool `json:"ForceRemove"` IsRemoveDelay bool `json:"IsRemoveDelay"` IsRecovery bool `json:"IsRecovery"` }
CreateOption is exported cluster create containers option values. `IsReCreate` indicates whether to re-create an existing containers each time it is built. `ForceRemove` is an attached property. When `IsReCreate` is true, it means to force delete or directly upgrade an existing containers. `IsRemoveDelay` delay (8 minutes) remove unused containers for service debounce. `IsRecovery` service containers recovery check enable.
type CreatedContainer ¶
type CreatedContainer struct { IP string `json:"IP"` HostName string `json:"HostName"` models.Container }
CreatedContainer is exported
type CreatedContainers ¶
type CreatedContainers []*CreatedContainer
CreatedContainers is exported
func (CreatedContainers) SetCreatedPair ¶
func (created CreatedContainers) SetCreatedPair(ip string, hostname string, container models.Container) CreatedContainers
SetCreatedPair is exported
type EngineContainer ¶
type EngineContainer struct { IP string `json:"IP"` HostName string `json:"HostName"` Container models.Container `json:"Container"` }
EngineContainer is exported
type GroupContainer ¶
type GroupContainer struct { GroupID string `json:"GroupId"` MetaID string `json:"MetaId"` IsRemoveDelay bool `json:"IsRemoveDelay"` IsRecovery bool `json:"IsRecovery"` Instances int `json:"Instances"` Placement Placement `json:"Placement"` WebHooks WebHooks `json:"WebHooks"` Config models.Container `json:"Config"` Containers []*EngineContainer `json:"Containers"` CreateAt int64 `json:"CreateAt"` LastUpdateAt int64 `json:"LastUpdateAt"` }
GroupContainer is exported
type NodeCache ¶
NodeCache is exported
func (*NodeCache) ContainsOtherKey ¶
ContainsOtherKey is exported
type NodeClusterOptions ¶
type NodeClusterOptions struct { ClusterName string ClusterURIs string ClusterHeartBeat time.Duration ClusterTTL time.Duration }
NodeClusterOptions is exported
type NodeData ¶
type NodeData struct { ID string `json:"id"` Name string `json:"name"` IP string `json:"ip"` APIAddr string `json:"apiaddr"` Cpus int64 `json:"cpus"` Memory int64 `json:"memory"` StorageDirver string `json:"storagedirver"` KernelVersion string `json:"kernelversion"` Architecture string `json:"architecture"` OperatingSystem string `json:"operatingsystem"` OSType string `json:"ostype"` EngineLabels []string `json:"lables"` AppVersion string `json:"appversion"` DockerVersion string `json:"dockerversion"` // contains filtered or unexported fields }
NodeData is exported
func (*NodeData) MapEngineLabels ¶
MapEngineLabels is exported covert nodedata's engine labels []string to map
type NodeRegisterOptions ¶
NodeRegisterOptions is exported
func NewNodeRegisterOptions ¶
func NewNodeRegisterOptions(ipAddr string, bindPort int, nodeConfig *models.Config) *NodeRegisterOptions
NewNodeRegisterOptions is exported
type OperatedContainer ¶
type OperatedContainer struct { IP string `json:"IP"` HostName string `json:"HostName"` ContainerID string `json:"ContainerId"` Result string `json:"Result"` }
OperatedContainer is exported
type OperatedContainers ¶
type OperatedContainers []*OperatedContainer
OperatedContainers is exported
func (OperatedContainers) SetOperatedPair ¶
func (operated OperatedContainers) SetOperatedPair(ip string, hostname string, containerid string, action string, err error) OperatedContainers
SetOperatedPair is exported
type Placement ¶
type Placement struct { Constraints []string `json:"Constraints"` Preferences []Preference `json:"Preferences"` Platforms []Platform `json:"Platforms"` }
Placement is exported Cluster services placement constraints
type RemovedContainer ¶
type RemovedContainer struct { IP string `json:"IP"` HostName string `json:"HostName"` ContainerID string `json:"ContainerId"` Result string `json:"Result"` }
RemovedContainer is exported
type RemovedContainers ¶
type RemovedContainers []*RemovedContainer
RemovedContainers is exported
func (RemovedContainers) SetRemovedPair ¶
func (removed RemovedContainers) SetRemovedPair(ip string, hostname string, containerid string, err error) RemovedContainers
SetRemovedPair is exported
type ResponseError ¶
type ResponseError struct { Code int `json:"Code"` Detail string `json:"Detail"` Message string `json:"Message"` }
ResponseError is exported
type Spread ¶
type Spread struct {
SpreadDescriptor string `json:"SpreadDescriptor"`
}
Spread is exported
type UpdateOption ¶
type UpdateOption struct { IsRemoveDelay bool `json:"IsRemoveDelay"` IsRecovery bool `json:"IsRecovery"` }
UpdateOption is exported
type UpgradeContainer ¶
type UpgradeContainer struct { IP string `json:"IP"` HostName string `json:"HostName"` models.Container }
UpgradeContainer is exported
type UpgradeContainerResponse ¶
type UpgradeContainerResponse struct {
ID string `json:"Id"`
}
UpgradeContainerResponse is exported
type UpgradeContainers ¶
type UpgradeContainers []*UpgradeContainer
UpgradeContainers is exported
func (UpgradeContainers) SetUpgradePair ¶
func (upgrade UpgradeContainers) SetUpgradePair(ip string, hostname string, container models.Container) UpgradeContainers
SetUpgradePair is exported