Documentation
¶
Index ¶
- func DeleteAllContaienrUnderSvc(svcname, namespace string) (err error)
- func DeleteContainerByName(conname, svcname, namespace string) (err error)
- func SaveContainer(con *Container) (err error)
- func UpgradeContaienrByName(con *Container) (err error)
- func UpgradeContainerNetByName(conname, svcname, namespace string, net []NetConfigure) (isChange bool, err error)
- type Container
- type NetConfigure
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteAllContaienrUnderSvc ¶
DeleteAllContaienrUnderSvc 删除指定服务下面的所有容器
func DeleteContainerByName ¶
DeleteContainerByName 根据名称删除容器配置信息 conname 容器名称 svcname 服务名称 namespace 命名空间名称
func SaveContainer ¶
func UpgradeContaienrByName ¶
UpgradeContaienrByName 升级容器配置信息 con 容器配置指针
func UpgradeContainerNetByName ¶
func UpgradeContainerNetByName(conname, svcname, namespace string, net []NetConfigure) (isChange bool, err error)
UpgradeContainerNetByName 更新容器的网络配置信息 conname 容器名称 svcname 服务名称 namespace 命名空间名称 net 网络配置数据 如果网络数据发生变化,则isChange为true,反之为false
Types ¶
type Container ¶
type Container struct { ID bson.ObjectId `json:"id,omitempty" bson:"_id,omitempty"` Name string `json:"name"` Img string `json:"img"` Cmd []string `json:"cmd"` Env map[string]string `json:"env"` Svc string `json:"svc"` Nsme string `json:"namespace"` Idx int `json:"idx"` Net []NetConfigure `json:"net"` Port []int `json:"port"` }
func GetAllContainersBySvc ¶
GetAllContainersBySvc 获取指定服务下面所有的容器数据 svcname 服务名称 namespace 命名空间名称
func GetContainerByName ¶
GetContainerByName 根据名称获取容器配置信息 conname 容器名称 svcname 服务名称 namespace 命名空间名称
type NetConfigure ¶
type NetConfigure struct { AccessType int `json:"access_type"` InPort int `json:"in_port"` OutPort int `json:"out_port"` Protocol int `json:"protocol"` }
NetConfigure 服务配置信息 accessType 默认为ClusterIP:
0 - ClusterIP 1 - LoadBalancer 2 - SvcLBTypeInner
Inport 容器监听端口 Outport 负载监听端口 protocol 协议类型 默认为TCP
0 - TCP 1 - UDP
func (*NetConfigure) ToString ¶
func (net *NetConfigure) ToString() (out string)
Click to show internal directories.
Click to hide internal directories.