Version: v1.0.6 Latest Latest

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

Go to latest
Published: Oct 31, 2016 License: Apache-2.0 Imports: 30 Imported by: 0




View Source
const (
	CONTAINER_RM   = "rm"
View Source
const (
	CodeListContainerParamError        = "400-11001"
	CodePatchContainerParamError       = "400-11002"
	CodePatchContainerMethodUndefined  = "400-11003"
	CodeDeleteContainerParamError      = "400-11004"
	CodeDeleteContainerMethodUndefined = "400-11005"
View Source
const (
	CodeConnectNetworkParamError  = "400-11201"
	CodeConnectNetworkMethodError = "400-11202"
	CodeCreateNetworkParamError   = "400-11203"
	CodeInspectNetworkParamError  = "400-11204"
	CodeListNetworkParamError     = "400-11205"
View Source
const (
	NETWORK_CONNECT    = "connect"
	NETWORK_DISCONNECT = "disconnect"
View Source
const (
	CodeUpdateNodeParamError = "400-11301"
	CodeCreateNodeParamError = "400-11306"
View Source
const (
	CodeUpdateServiceParamError = "400-11401"
	CodeCreateServiceParamError = "400-11402"
	CodeScaleServiceParamError  = "400-11403"

	CodeListTaskParamError = "400-11404"
View Source
const (
	//Stack error code
	CodeCreateStackParamError = "400-11501"
	CodeInvalidStackName      = "503-11502"
	CodeStackNotFound         = "404-11503"

	CodeInvalidGroupId = "400-12001"
View Source
const (
View Source
const (
	CodeCreateVolumeParamError = "400-11601"
View Source
const (
	//Get config error code
	CodeGetConfigError = "503-11901"
View Source
const (
	//Image error code
	CodeListImageParamError = "400-11101"


This section is empty.


This section is empty.


type Api

type Api struct {
	Client *dockerclient.CraneDockerClient
	Config *config.Config

func (*Api) ApiRouter

func (api *Api) ApiRouter() *gin.Engine

func (*Api) ConnectContainer

func (api *Api) ConnectContainer(ctx *gin.Context)

func (*Api) ConnectNetwork

func (api *Api) ConnectNetwork(ctx *gin.Context)

func (*Api) ConnectNodeNetwork

func (api *Api) ConnectNodeNetwork(ctx *gin.Context)

func (*Api) CraneConfig

func (api *Api) CraneConfig(ctx *gin.Context)

func (*Api) CreateNetwork

func (api *Api) CreateNetwork(ctx *gin.Context)

func (*Api) CreateNode

func (api *Api) CreateNode(ctx *gin.Context)

func (*Api) CreateNodeNetwork

func (api *Api) CreateNodeNetwork(ctx *gin.Context)

func (*Api) CreateService

func (api *Api) CreateService(ctx *gin.Context)

ServiceCreate creates a new Service.

func (*Api) CreateStack

func (api *Api) CreateStack(ctx *gin.Context)

func (*Api) CreateVolume

func (api *Api) CreateVolume(ctx *gin.Context)

func (*Api) DeleteContainer

func (api *Api) DeleteContainer(ctx *gin.Context)

func (*Api) DiffContainer

func (api *Api) DiffContainer(ctx *gin.Context)

func (*Api) GetConfig

func (api *Api) GetConfig() *config.Config

func (*Api) GetDockerClient

func (api *Api) GetDockerClient() *dockerclient.CraneDockerClient

func (*Api) HealthCheck

func (api *Api) HealthCheck(ctx *gin.Context)

func (*Api) Help

func (api *Api) Help(engine *gin.Engine) gin.HandlerFunc

func (*Api) ImageHistory

func (api *Api) ImageHistory(ctx *gin.Context)

func (*Api) Info

func (api *Api) Info(ctx *gin.Context)

func (*Api) InspectContainer

func (api *Api) InspectContainer(ctx *gin.Context)

func (*Api) InspectImage

func (api *Api) InspectImage(ctx *gin.Context)

func (*Api) InspectNetwork

func (api *Api) InspectNetwork(ctx *gin.Context)

func (*Api) InspectNode

func (api *Api) InspectNode(ctx *gin.Context)

func (*Api) InspectNodeNetwork

func (api *Api) InspectNodeNetwork(ctx *gin.Context)

func (*Api) InspectService

func (api *Api) InspectService(ctx *gin.Context)

func (*Api) InspectStack

func (api *Api) InspectStack(ctx *gin.Context)

func (*Api) InspectTask

func (api *Api) InspectTask(ctx *gin.Context)

func (*Api) InspectVolume

func (api *Api) InspectVolume(ctx *gin.Context)

func (*Api) ListContainers

func (api *Api) ListContainers(ctx *gin.Context)

func (*Api) ListImages

func (api *Api) ListImages(ctx *gin.Context)

func (*Api) ListNetworks

func (api *Api) ListNetworks(ctx *gin.Context)

func (*Api) ListNodeNetworks

func (api *Api) ListNodeNetworks(ctx *gin.Context)

func (*Api) ListNodes

func (api *Api) ListNodes(ctx *gin.Context)

func (*Api) ListStack

func (api *Api) ListStack(ctx *gin.Context)

func (*Api) ListStackService

func (api *Api) ListStackService(ctx *gin.Context)

func (*Api) ListTasks

func (api *Api) ListTasks(ctx *gin.Context)

func (*Api) ListVolume

func (api *Api) ListVolume(ctx *gin.Context)

func (*Api) LogsContainer

func (api *Api) LogsContainer(ctx *gin.Context)

func (*Api) LogsService

func (api *Api) LogsService(ctx *gin.Context)

func (*Api) ManagerInfo

func (api *Api) ManagerInfo(ctx *gin.Context)

func (*Api) PatchContainer

func (api *Api) PatchContainer(ctx *gin.Context)

func (*Api) RemoveImage

func (api *Api) RemoveImage(ctx *gin.Context)

RemoveImage remove image in assign host by image id/name

func (*Api) RemoveNetwork

func (api *Api) RemoveNetwork(ctx *gin.Context)

func (*Api) RemoveNode

func (api *Api) RemoveNode(ctx *gin.Context)

func (*Api) RemoveService

func (api *Api) RemoveService(ctx *gin.Context)

func (*Api) RemoveStack

func (api *Api) RemoveStack(ctx *gin.Context)

func (*Api) RemoveVolume

func (api *Api) RemoveVolume(ctx *gin.Context)

func (*Api) ScaleService

func (api *Api) ScaleService(ctx *gin.Context)

func (*Api) ServiceCDAddr

func (api *Api) ServiceCDAddr(ctx *gin.Context)

func (*Api) StatsContainer

func (api *Api) StatsContainer(ctx *gin.Context)

func (*Api) StatsService

func (api *Api) StatsService(ctx *gin.Context)

func (*Api) UpdateNode

func (api *Api) UpdateNode(ctx *gin.Context)

func (*Api) UpdateService

func (api *Api) UpdateService(ctx *gin.Context)

update single service notice update service api only update service spec if network does not exist return error and don't add default label about stack and registry auth

func (*Api) UpdateServiceImage

func (api *Api) UpdateServiceImage(ctx *gin.Context)

func (*Api) UpdateStack

func (api *Api) UpdateStack(ctx *gin.Context)

type ConnectNetworkRequest

type ConnectNetworkRequest struct {
	Method         string
	NetworkOptions docker.NetworkConnectionOptions

type ContainerRequest

type ContainerRequest struct {
	Method string `json:"Method"`
	Name   string `json:"Name"`
	Height int    `json:"Height"`
	Width  int    `json:"Width"`

type CraneConfigResponse

type CraneConfigResponse struct {
	Version      string      `json:"Version"`
	BuildTime    string      `json:"Build"`
	FeatureFlags []string    `json:"FeatureFlags"`
	SwarmInfo    swarm.Swarm `json:"SwarmInfo"`
	NumGoroutine int

type RouteInfo

type RouteInfo struct {
	Method string `json:"Method"`
	Path   string `json:"Path"`


Path Synopsis

Jump to

Keyboard shortcuts

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