types

package
v0.0.0-...-b392570 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2018 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NodeClose

func NodeClose()

NodeClose is exported register close

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 GroupContainers

type GroupContainers []*GroupContainer

GroupContainers is exported

type Node

type Node struct {
	Key     string
	Cluster string
	// contains filtered or unexported fields
}

Node is exported

type NodeCache

type NodeCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

NodeCache is exported

func NewNodeCache

func NewNodeCache() *NodeCache

NewNodeCache is exported

func (*NodeCache) Add

func (cache *NodeCache) Add(key string, nodeData *NodeData)

Add is exported nodeCache add online nodeData.

func (*NodeCache) ContainsOtherKey

func (cache *NodeCache) ContainsOtherKey(key string, IPOrName string) bool

ContainsOtherKey is exported

func (*NodeCache) Get

func (cache *NodeCache) Get(IPOrName string) *NodeData

Get is exported nodeCache get nodeData of server ip or server hostname

func (*NodeCache) Node

func (cache *NodeCache) Node(key string) *NodeData

Node is exported nodeCache get nodedata of key

func (*NodeCache) Remove

func (cache *NodeCache) Remove(key string)

Remove is exported nodeCache remove offline nodeData.

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 GetNodeData

func GetNodeData() *NodeData

GetNodeData is exported

func (*NodeData) MapEngineLabels

func (nodeData *NodeData) MapEngineLabels() map[string]string

MapEngineLabels is exported covert nodedata's engine labels []string to map

type NodeOptions

type NodeOptions struct {
	NodeData
	NodeClusterOptions
}

NodeOptions is exported

type NodeRegisterOptions

type NodeRegisterOptions struct {
	IPAddr     string
	BindPort   int
	NodeConfig *models.Config
}

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 Platform

type Platform struct {
	Architecture string `json:"Architecture"`
	OS           string `json:"OS"`
}

Platform is exported

type Preference

type Preference struct {
	Spread `json:"Spread"`
}

Preference is exported

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

type WebHook

type WebHook struct {
	URL         string `json:"Url"`
	SecretToken string `json:"SecretToken"`
}

WebHook is exported

type WebHooks

type WebHooks []WebHook

WebHooks is exported

Jump to

Keyboard shortcuts

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