cr

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildImageFromTarContext

func BuildImageFromTarContext(challengeName, challengeTag, tarContextPath, dockerCtxFile string) (*bytes.Buffer, string, error)

func CheckIfImageExists

func CheckIfImageExists(imageId string) (bool, error)

func CommitContainer

func CommitContainer(containerId string) (string, error)

func CreateContainerFromImage

func CreateContainerFromImage(containerConfig *CreateContainerConfig) (string, error)

func GetValidTrafficTypes

func GetValidTrafficTypes() []string

func IsValidTrafficType

func IsValidTrafficType(t string) bool

func RemoveImage

func RemoveImage(imageId string) error

func SearchContainerByFilter

func SearchContainerByFilter(filterMap map[string]string) ([]types.Container, error)

func SearchImageByFilter

func SearchImageByFilter(filterMap map[string]string) ([]types.ImageSummary, error)

func ShowLiveContainerLogs

func ShowLiveContainerLogs(containerID string)

func StopAndRemoveContainer

func StopAndRemoveContainer(containerId string) error

Types

type CreateContainerConfig

type CreateContainerConfig struct {
	PortMapping      []PortMapping
	MountsMap        map[string]string
	ImageId          string
	ContainerName    string
	ContainerEnv     []string
	ContainerNetwork string
	Traffic          TrafficType

	CPUShares int64
	Memory    int64
	PidsLimit int64
}

func (*CreateContainerConfig) TrafficType

func (c *CreateContainerConfig) TrafficType() string

type Log

type Log struct {
	Stderr string
	Stdout string
}

func GetContainerStdLogs

func GetContainerStdLogs(containerID string) (*Log, error)

type PortMapping

type PortMapping struct {
	HostPort      uint32
	ContainerPort uint32
}

type TrafficType

type TrafficType string

TrafficType is the protocol supported by container ingress and egress through the port mappings.

const (
	TCPTraffic TrafficType = "tcp"
	UDPTraffic TrafficType = "udp"

	DefaultTraffic TrafficType = TCPTraffic
)

func (TrafficType) String

func (t TrafficType) String() string

String returns the string representation of the traffic type.

Jump to

Keyboard shortcuts

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