models

package
v0.0.0-...-e933087 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DockerClientSavePath string

DockerClientSavePath is the path to save clients

Functions

func Hash

func Hash(s string) uint32

Hash returns its hashed value

func ListContainerOption

func ListContainerOption(flag int) docker.ListContainersOptions

ListContainerOption returns docker.ListContainersOptions according to the flag @param flag int (0: all, 1: created, 2: restarting, 3: running, 4: paused, 5&6: exited)

func RemoveDockerClient

func RemoveDockerClient(id string) bool

RemoveDockerClient removes your specified configuration

func RemoveDockerClientByEndpoint

func RemoveDockerClientByEndpoint(endpoint string)

RemoveDockerClientByEndpoint removes your specified configuration

Types

type DockerClient

type DockerClient struct {
	ID       string `json:"id"`
	Endpoint string `json:"endpoint"`
	CertPath string `json:"certPath"`
	IsActive bool   `json:"isActive"`
}

DockerClient represents a Docker client

func LoadDockerClients

func LoadDockerClients() (clients []*DockerClient, err error)

LoadDockerClients returns registered clients

func (*DockerClient) Load

func (c *DockerClient) Load()

Load select its configuration

func (*DockerClient) Save

func (c *DockerClient) Save()

Save persists the client configuration

type DockerContainer

type DockerContainer struct {
	ID         string            `json:"id"`
	Image      string            `json:"image,omitempty"`
	Command    string            `json:"command,omitempty"`
	Created    int64             `json:"created,omitempty"`
	Status     string            `json:"status,omitempty"`
	Ports      []docker.APIPort  `json:"ports,omitempty"`
	SizeRw     int64             `json:"sizeRw,omitempty"`
	SizeRootFs int64             `json:"sizeRootFs,omitempty"`
	Names      []string          `json:"names,omitempty"`
	Labels     map[string]string `json:"labels,omitempty"`
}

DockerContainer represents a container

type DockerContainers

type DockerContainers []DockerContainer

DockerContainers represents list of DockerContainer

func SearchContainers

func SearchContainers(containers []docker.APIContainers, words []string) DockerContainers

SearchContainers checks whether it contains key word or not

func (DockerContainers) Len

func (cons DockerContainers) Len() int

func (DockerContainers) Less

func (cons DockerContainers) Less(i, j int) bool

func (DockerContainers) Swap

func (cons DockerContainers) Swap(i, j int)

type DockerImage

type DockerImage struct {
	ID          string            `json:"id"`
	RepoTags    []string          `json:"repoTags,omitempty"`
	Created     int64             `json:"created,omitempty"`
	Size        int64             `json:"size,omitempty"`
	VirtualSize int64             `json:"virtualSize,omitempty"`
	ParentID    string            `json:"parentId,omitempty"`
	RepoDigests []string          `json:"repoDigests,omitempty"`
	Labels      map[string]string `json:"labels,omitempty"`
}

DockerImage represents a Image

type DockerImages

type DockerImages []DockerImage

DockerImages represents list of DockerImage

func SearchImages

func SearchImages(images []docker.APIImages, words []string) DockerImages

SearchImages checks whether it contains key word or not

func (DockerImages) Len

func (imgs DockerImages) Len() int

func (DockerImages) Less

func (imgs DockerImages) Less(i, j int) bool

func (DockerImages) Swap

func (imgs DockerImages) Swap(i, j int)

type DockerStats

type DockerStats struct {
	ID    string
	Name  string
	Stats []*docker.Stats
}

DockerStats represents a container's stats

Jump to

Keyboard shortcuts

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