server

package
v0.0.0-...-0feb76b Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2020 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SupportGRpcArrayPortToArrayNatPot

func SupportGRpcArrayPortToArrayNatPot(
	pt []*pb.Port,
) (
	ret []nat.Port,
	err error,
)

func SupportGRpcToArrayMount

func SupportGRpcToArrayMount(
	pt []*pb.Mount,
) (
	mountList []mount.Mount,
)

func SupportGRpcToContainerPolicy

func SupportGRpcToContainerPolicy(
	value string,
) (
	policy iotmakerdocker.RestartPolicy,
	err error,
)

func SupportStringToNetworkDrive

func SupportStringToNetworkDrive(str string) (drive iotmakerdocker.NetworkDrive)

func SupportStringToPort

func SupportStringToPort(
	in string,
) (
	port nat.Port,
	err error,
)

Types

type Address

type Address struct {
	Addr      string
	PrefixLen int
}

type BindOptions

type BindOptions struct {
	Propagation  Propagation
	NonRecursive bool
}

type BuildOrPullLog

type BuildOrPullLog struct {
	Status iotmakerdocker.ContainerPullStatusSendToChannel
	Log    string
	Start  time.Time
}

type CgroupSpec

type CgroupSpec string

type Config

type Config struct {
	Hostname        string              // Hostname
	Domainname      string              // Domainname
	User            string              // User that will run the command(s) inside the container, also support user:group
	AttachStdin     bool                // Attach the standard input, makes possible user interaction
	AttachStdout    bool                // Attach the standard output
	AttachStderr    bool                // Attach the standard error
	ExposedPorts    PortSet             `json:",omitempty"` // List of exposed ports
	Tty             bool                // Attach standard streams to a tty, including stdin if it is not closed.
	OpenStdin       bool                // Open stdin
	StdinOnce       bool                // If true, close stdin after the 1 attached client disconnects.
	Env             []string            // List of environment variable to set in the container
	Cmd             StrSlice            // Command to run when starting the container
	Healthcheck     HealthConfig        `json:",omitempty"` // Healthcheck describes how to check the container is healthy
	ArgsEscaped     bool                `json:",omitempty"` // True if command is already escaped (meaning treat as a command line) (Windows specific).
	Image           string              // Name of the image as it was passed by the operator (e.g. could be symbolic)
	Volumes         map[string]struct{} // List of volumes (mounts) used for the container
	WorkingDir      string              // Current directory (PWD) in the command will be launched
	Entrypoint      StrSlice            // Entrypoint to run when starting the container
	NetworkDisabled bool                `json:",omitempty"` // Is network disabled
	MacAddress      string              `json:",omitempty"` // Mac Address of the container
	OnBuild         []string            // ONBUILD metadata that were defined on the image Dockerfile
	Labels          map[string]string   // List of labels set to this container
	StopSignal      string              `json:",omitempty"` // Signal to stop a container
	StopTimeout     int                 `json:",omitempty"` // Timeout (in seconds) to stop a container
	Shell           StrSlice            `json:",omitempty"` // Shell for shell-form of RUN, CMD, ENTRYPOINT
}

type ConfigReference

type ConfigReference struct {
	Network string
}

type Consistency

type Consistency string

type ContainerJSON

type ContainerJSON struct {
	ContainerJSONBase
	Mounts          []MountPoint
	Config          Config
	NetworkSettings NetworkSettings
}

func (*ContainerJSON) FromContainer

func (el *ContainerJSON) FromContainer(data types.ContainerJSON)

type ContainerJSONBase

type ContainerJSONBase struct {
	ID              string
	Created         string
	Path            string
	Args            []string
	State           ContainerState
	Image           string
	ResolvConfPath  string
	HostnamePath    string
	HostsPath       string
	LogPath         string
	Node            ContainerNode
	Name            string
	RestartCount    int
	Driver          string
	Platform        string
	MountLabel      string
	ProcessLabel    string
	AppArmorProfile string
	ExecIDs         []string
	HostConfig      HostConfig
	GraphDriver     GraphDriverData
	SizeRw          int64
	SizeRootFs      int64
}

type ContainerNode

type ContainerNode struct {
	ID        string
	IPAddress string
	Addr      string
	Name      string
	Cpus      int
	Memory    int64
	Labels    map[string]string
}

type ContainerState

type ContainerState struct {
	Status     string
	Running    bool
	Paused     bool
	Restarting bool
	OOMKilled  bool
	Dead       bool
	Pid        int
	ExitCode   int
	Error      string
	StartedAt  string
	FinishedAt string
	Health     Health
}

type DefaultNetworkSettings

type DefaultNetworkSettings struct {
	EndpointID          string
	Gateway             string
	GlobalIPv6Address   string
	GlobalIPv6PrefixLen int
	IPAddress           string
	IPPrefixLen         int
	IPv6Gateway         string
	MacAddress          string
}

type DeviceMapping

type DeviceMapping struct {
	PathOnHost        string
	PathInContainer   string
	CgroupPermissions string
}

type DeviceRequest

type DeviceRequest struct {
	Driver       string
	Count        int
	DeviceIDs    []string
	Capabilities [][]string
	Options      map[string]string
}

type Driver

type Driver struct {
	Name    string
	Options map[string]string
}

type EndpointIPAMConfig

type EndpointIPAMConfig struct {
	IPv4Address  string
	IPv6Address  string
	LinkLocalIPs []string
}

type EndpointResource

type EndpointResource struct {
	Name        string
	EndpointID  string
	MacAddress  string
	IPv4Address string
	IPv6Address string
}

type EndpointSettings

type EndpointSettings struct {
	IPAMConfig          EndpointIPAMConfig
	Links               []string
	Aliases             []string
	NetworkID           string
	EndpointID          string
	Gateway             string
	IPAddress           string
	IPPrefixLen         int
	IPv6Gateway         string
	GlobalIPv6Address   string
	GlobalIPv6PrefixLen int
	MacAddress          string
	DriverOpts          map[string]string
}

type GRpcServer

type GRpcServer struct {
	pb.UnimplementedDockerServerServer
	// contains filtered or unexported fields
}

func (*GRpcServer) ContainerCreate

func (el *GRpcServer) ContainerCreate(
	ctx context.Context,
	in *pb.ContainerCreateRequest,
) (
	response *pb.ContainerCreateReply,
	err error,
)

func (*GRpcServer) ContainerCreateAndExposePortsAutomatically

func (el *GRpcServer) ContainerCreateAndExposePortsAutomatically(
	ctx context.Context,
	in *pb.ContainerCreateAndExposePortsAutomaticallyRequest,
) (
	response *pb.ContainerCreateAndExposePortsAutomaticallyReply,
	err error,
)

func (*GRpcServer) ContainerCreateAndStart

func (el *GRpcServer) ContainerCreateAndStart(
	ctx context.Context,
	in *pb.ContainerCreateAndStartRequest,
) (
	response *pb.ContainerCreateAndStartReply,
	err error,
)

func (*GRpcServer) ContainerFindIdByName

func (el *GRpcServer) ContainerFindIdByName(
	ctx context.Context,
	in *pb.ContainerFindIdByNameRequest,
) (
	response *pb.ContainerFindIdByNameReply,
	err error,
)

func (*GRpcServer) ContainerFindIdByNameContains

func (el *GRpcServer) ContainerFindIdByNameContains(
	ctx context.Context,
	in *pb.ContainerFindIdByNameContainsRequest,
) (
	response *pb.ContainerFindIdByNameContainsReply,
	err error,
)

func (*GRpcServer) ContainerInspect

func (el *GRpcServer) ContainerInspect(
	ctx context.Context,
	in *pb.ContainerInspectRequest,
) (
	response *pb.ContainerInspectReply,
	err error,
)

func (*GRpcServer) ContainerInspectByName

func (el *GRpcServer) ContainerInspectByName(
	ctx context.Context,
	in *pb.ContainerInspectByNameRequest,
) (
	response *pb.ContainerInspectByNameReply,
	err error,
)

func (*GRpcServer) ContainerInspectByNameContains

func (el *GRpcServer) ContainerInspectByNameContains(
	ctx context.Context,
	in *pb.ContainerInspectByNameContainsRequest,
) (
	response *pb.ContainerInspectByNameContainsReply,
	err error,
)

func (*GRpcServer) ContainerListAll

func (el *GRpcServer) ContainerListAll(
	ctx context.Context,
	in *pb.Empty,
) (
	response *pb.ContainerListAllReply,
	err error,
)

func (*GRpcServer) ContainerRemove

func (el *GRpcServer) ContainerRemove(
	ctx context.Context,
	in *pb.ContainerRemoveRequest,
) (
	response *pb.Empty,
	err error,
)

func (*GRpcServer) ContainerStart

func (el *GRpcServer) ContainerStart(
	ctx context.Context,
	in *pb.ContainerStartRequest,
) (
	response *pb.Empty,
	err error,
)

func (*GRpcServer) ContainerStatisticsOneShot

func (el *GRpcServer) ContainerStatisticsOneShot(
	ctx context.Context,
	in *pb.ContainerStatisticsOneShotRequest,
) (
	response *pb.ContainerStatisticsOneShotReply,
	err error,
)

func (*GRpcServer) ContainerStatisticsOneShotByName

func (el *GRpcServer) ContainerStatisticsOneShotByName(
	ctx context.Context,
	in *pb.ContainerStatisticsOneShotByNameRequest,
) (
	response *pb.ContainerStatisticsOneShotReply,
	err error,
)

func (*GRpcServer) ContainerStop

func (el *GRpcServer) ContainerStop(
	ctx context.Context,
	in *pb.ContainerStopRequest,
) (
	response *pb.Empty,
	err error,
)

func (*GRpcServer) ContainerStopAndRemove

func (el *GRpcServer) ContainerStopAndRemove(
	ctx context.Context,
	in *pb.ContainerStopAndRemoveRequest,
) (
	response *pb.Empty,
	err error,
)

func (*GRpcServer) ContainerWaitStatusNotRunning

func (el *GRpcServer) ContainerWaitStatusNotRunning(
	ctx context.Context,
	in *pb.ContainerWaitStatusNotRunningRequest,
) (
	response *pb.Empty,
	err error,
)

func (*GRpcServer) ImageBuildFromRemoteServer

func (el *GRpcServer) ImageBuildFromRemoteServer(
	ctx context.Context,
	in *pb.ImageBuildFromRemoteServerRequest,
) (
	response *pb.ImageBuildFromRemoteServerReply,
	err error,
)

func (*GRpcServer) ImageBuildFromRemoteServerStatus

func (el *GRpcServer) ImageBuildFromRemoteServerStatus(
	ctx context.Context,
	in *pb.ImageOrContainerBuildPullStatusRequest,
) (
	response *pb.ImageOrContainerBuildPullStatusReply,
	err error,
)

func (*GRpcServer) ImageFindIdByName

func (el *GRpcServer) ImageFindIdByName(
	ctx context.Context,
	in *pb.ImageFindIdByNameRequest,
) (
	response *pb.ImageFindIdByNameReply,
	err error,
)

func (*GRpcServer) ImageGarbageCollector

func (el *GRpcServer) ImageGarbageCollector(
	ctx context.Context,
	in *pb.Empty,
) (
	response *pb.Empty,
	err error,
)

func (*GRpcServer) ImageList

func (el *GRpcServer) ImageList(
	ctx context.Context,
	in *pb.Empty,
) (
	response *pb.ImageListReply,
	err error,
)

func (*GRpcServer) ImageListExposedPorts

func (el *GRpcServer) ImageListExposedPorts(
	ctx context.Context,
	in *pb.ImageListExposedPortsRequest,
) (
	response *pb.ImageListExposedPortsReply,
	err error,
)

func (*GRpcServer) ImageListExposedPortsByName

func (el *GRpcServer) ImageListExposedPortsByName(
	ctx context.Context,
	in *pb.ImageListExposedPortsByNameRequest,
) (
	response *pb.ImageListExposedPortsByNameReply,
	err error,
)

func (*GRpcServer) ImageListExposedVolumes

func (el *GRpcServer) ImageListExposedVolumes(
	ctx context.Context,
	in *pb.ImageListExposedVolumesRequest,
) (
	response *pb.ImageListExposedVolumesReply,
	err error,
)

func (*GRpcServer) ImageListExposedVolumesByName

func (el *GRpcServer) ImageListExposedVolumesByName(
	ctx context.Context,
	in *pb.ImageListExposedVolumesByNameRequest,
) (
	response *pb.ImageListExposedVolumesByNameReply,
	err error,
)

func (*GRpcServer) ImageMountNatPortListChangeExposed

func (el *GRpcServer) ImageMountNatPortListChangeExposed(
	ctx context.Context,
	in *pb.ImageMountNatPortListChangeExposedRequest,
) (
	response *pb.ImageMountNatPortListChangeExposedReply,
	err error,
)

func (*GRpcServer) ImagePull

func (el *GRpcServer) ImagePull(
	ctx context.Context,
	in *pb.ImagePullRequest,
) (
	response *pb.ImagePullReply,
	err error,
)

func (*GRpcServer) ImageRemove

func (el *GRpcServer) ImageRemove(
	ctx context.Context,
	in *pb.ImageRemoveRequest,
) (
	response *pb.Empty,
	err error,
)

func (*GRpcServer) ImageRemoveByName

func (el *GRpcServer) ImageRemoveByName(
	ctx context.Context,
	in *pb.ImageRemoveByNameRequest,
) (
	response *pb.Empty,
	err error,
)

func (*GRpcServer) Init

func (el *GRpcServer) Init() (err error)

func (*GRpcServer) InitForce

func (el *GRpcServer) InitForce() (err error)

func (*GRpcServer) NetworkCreate

func (el *GRpcServer) NetworkCreate(
	ctx context.Context,
	in *pb.NetworkCreateRequest,
) (
	response *pb.NetworkCreateReply,
	err error,
)

func (*GRpcServer) NetworkFindIdByName

func (el *GRpcServer) NetworkFindIdByName(
	ctx context.Context,
	in *pb.NetworkFindIdByNameRequest,
) (
	response *pb.NetworkFindIdByNameReply,
	err error,
)

func (*GRpcServer) NetworkInspect

func (el *GRpcServer) NetworkInspect(
	ctx context.Context,
	in *pb.NetworkInspectRequest,
) (
	response *pb.NetworkInspectReply,
	err error,
)

func (*GRpcServer) NetworkList

func (el *GRpcServer) NetworkList(
	ctx context.Context,
	in *pb.Empty,
) (
	response *pb.NetworkListReply,
	err error,
)

func (*GRpcServer) NetworkRemove

func (el *GRpcServer) NetworkRemove(
	ctx context.Context,
	in *pb.NetworkRemoveRequest,
) (
	response *pb.Empty,
	err error,
)

func (*GRpcServer) NetworkRemoveByName

func (el *GRpcServer) NetworkRemoveByName(
	ctx context.Context,
	in *pb.NetworkRemoveByNameRequest,
) (
	response *pb.Empty,
	err error,
)

type GraphDriverData

type GraphDriverData struct {
	Data map[string]string
	Name string
}

type Health

type Health struct {
	Status        string
	FailingStreak int
	Log           []HealthCheckResult
}

type HealthCheckResult

type HealthCheckResult struct {
	Start    int64
	End      int64
	ExitCode int
	Output   string
}

type HealthConfig

type HealthConfig struct {
	Test        []string
	Interval    int64
	Timeout     int64
	StartPeriod int64
	Retries     int
}

type HostConfig

type HostConfig struct {
	Binds           []string
	ContainerIDFile string
	LogConfig       LogConfig
	NetworkMode     NetworkMode
	PortBindings    PortMap
	RestartPolicy   RestartPolicy
	AutoRemove      bool
	VolumeDriver    string
	VolumesFrom     []string
	CapAdd          StrSlice
	CapDrop         StrSlice
	Capabilities    []string
	DNS             []string
	DNSOptions      []string
	DNSSearch       []string
	ExtraHosts      []string
	GroupAdd        []string
	IpcMode         IpcMode
	Cgroup          CgroupSpec
	Links           []string
	OomScoreAdj     int
	PidMode         PidMode
	Privileged      bool
	PublishAllPorts bool
	ReadonlyRootfs  bool
	SecurityOpt     []string
	StorageOpt      map[string]string
	Tmpfs           map[string]string
	UTSMode         UTSMode
	UsernsMode      UsernsMode
	ShmSize         int64
	Sysctls         map[string]string
	Runtime         string
	ConsoleSize     [2]uint
	Isolation       Isolation
	Resources
	Mounts        []Mount
	MaskedPaths   []string
	ReadonlyPaths []string
	Init          bool
}

type IPAM

type IPAM struct {
	Driver  string
	Options map[string]string
	Config  []IPAMConfig
}

type IPAMConfig

type IPAMConfig struct {
	Subnet     string
	IPRange    string
	Gateway    string
	AuxAddress map[string]string
}

type IpcMode

type IpcMode string

type Isolation

type Isolation string

type JSonContainerGenericRequest

type JSonContainerGenericRequest struct {
	Name    string
	Id      string
	Volumes bool
	Links   bool
	Force   bool
}

type JSonImageBuildAndContainerStartFromRemoteServer

type JSonImageBuildAndContainerStartFromRemoteServer struct {
	ImageName     string
	ImageTags     []string
	ServerPath    string
	ContainerName string
	RestartPolicy iotmakerdocker.RestartPolicy
	MountVolumes  []mount.Mount
	NetworkName   string
	CurrentPort   []nat.Port
	ChangeToPort  []nat.Port
}

type JSonImageBuildFromRemoteServer

type JSonImageBuildFromRemoteServer struct {
	ImageName  string
	ImageTags  []string
	ServerPath string
}

type LogConfig

type LogConfig struct {
	Type   string
	Config map[string]string
}

type Mount

type Mount struct {
	Type          Type
	Source        string
	Target        string
	ReadOnly      bool
	Consistency   Consistency
	BindOptions   BindOptions
	VolumeOptions VolumeOptions
	TmpfsOptions  TmpfsOptions
}

type MountPoint

type MountPoint struct {
	Type        Type
	Name        string
	Source      string
	Destination string
	Driver      string
	Mode        string
	RW          bool
	Propagation Propagation
}

type NameAndId

type NameAndId struct {
	ID   string
	Name string
}

type NetworkControl

type NetworkControl struct {
	Generator *iotmakerdocker.NextNetworkAutoConfiguration
	ID        string
	Name      string
	Drive     string
	Scope     string
	Subnet    string
	Gateway   string
}

type NetworkMode

type NetworkMode string

type NetworkResource

type NetworkResource struct {
	Name       string
	ID         string
	Created    int64
	Scope      string
	Driver     string
	EnableIPv6 bool
	IPAM       IPAM
	Internal   bool
	Attachable bool
	Ingress    bool
	ConfigFrom ConfigReference
	ConfigOnly bool
	Containers map[string]EndpointResource
	Options    map[string]string
	Labels     map[string]string
	Peers      PeerInfo
	Services   map[string]ServiceInfo
}

type NetworkSettings

type NetworkSettings struct {
	NetworkSettingsBase
	DefaultNetworkSettings
	Networks map[string]EndpointSettings
}

type NetworkSettingsBase

type NetworkSettingsBase struct {
	Bridge                 string
	SandboxID              string
	HairpinMode            bool
	LinkLocalIPv6Address   string
	LinkLocalIPv6PrefixLen int
	Ports                  PortMap
	SandboxKey             string
	SecondaryIPAddresses   []Address
	SecondaryIPv6Addresses []Address
}

type PeerInfo

type PeerInfo struct {
	Name string
	IP   string
}

type PidMode

type PidMode string

type Port

type Port string

type PortBinding

type PortBinding struct {
	HostIP   string
	HostPort string
}

type PortMap

type PortMap map[Port][]PortBinding

type PortSet

type PortSet map[Port]struct{}

type Propagation

type Propagation string

type PullStatusList

type PullStatusList struct {
	// contains filtered or unexported fields
}

func (*PullStatusList) Get

func (el *PullStatusList) Get(key string) (value BuildOrPullLog, found bool)

func (*PullStatusList) Set

func (el *PullStatusList) Set(key string, value BuildOrPullLog)

func (*PullStatusList) TickerDeleteOldData

func (el *PullStatusList) TickerDeleteOldData()

func (*PullStatusList) Verify

func (el *PullStatusList) Verify(key string) (found bool)

type Resources

type Resources struct {
	CPUShares            int64
	Memory               int64
	NanoCPUs             int64
	CgroupParent         string
	BlkioWeight          uint16
	BlkioWeightDevice    []WeightDevice
	BlkioDeviceReadBps   []ThrottleDevice
	BlkioDeviceWriteBps  []ThrottleDevice
	BlkioDeviceReadIOps  []ThrottleDevice
	BlkioDeviceWriteIOps []ThrottleDevice
	CPUPeriod            int64
	CPUQuota             int64
	CPURealtimePeriod    int64
	CPURealtimeRuntime   int64
	CpusetCpus           string
	CpusetMems           string
	Devices              []DeviceMapping
	DeviceCgroupRules    []string
	DeviceRequests       []DeviceRequest
	KernelMemory         int64
	KernelMemoryTCP      int64
	MemoryReservation    int64
	MemorySwap           int64
	MemorySwappiness     int64
	OomKillDisable       bool
	PidsLimit            int64
	Ulimits              []Ulimit
	CPUCount             int64
	CPUPercent           int64
	IOMaximumIOps        uint64
	IOMaximumBandwidth   uint64
}

type RestartPolicy

type RestartPolicy struct {
	Name              string
	MaximumRetryCount int
}

type ServiceInfo

type ServiceInfo struct {
	VIP          string
	Ports        []string
	LocalLBIndex int
	Tasks        []Task
}

type StrSlice

type StrSlice []string

type Task

type Task struct {
	Name       string
	EndpointID string
	EndpointIP string
	Info       map[string]string
}

type ThrottleDevice

type ThrottleDevice struct {
	Path string
	Rate uint64
}

type TmpfsOptions

type TmpfsOptions struct {
	SizeBytes int64
	Mode      uint32
}

type Type

type Type string

type UTSMode

type UTSMode string

type Ulimit

type Ulimit struct {
	Name string
	Hard int64
	Soft int64
}

type UsernsMode

type UsernsMode string

type VolumeOptions

type VolumeOptions struct {
	NoCopy       bool
	Labels       map[string]string
	DriverConfig Driver
}

type WeightDevice

type WeightDevice struct {
	Path   string
	Weight uint16
}

type Zone

type Zone struct {
	Name   string
	Offset int
	IsDST  bool
}

type ZoneTrans

type ZoneTrans struct {
	When  int64
	Index uint8
	IsStd bool
	IsUtc bool
}

Source Files

Jump to

Keyboard shortcuts

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