transform

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package transform is for representing groups of docker containers in transition between various formats

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildContext

type BuildContext struct {
	Context    string
	Dockerfile string
	Args       map[string]string
}

BuildContext is an intermediary representation for build information

type Container

type Container struct {
	Build           *BuildContext
	Command         string
	CPU             int // out of 1024
	DNS             []string
	Domain          []string
	Entrypoint      string
	EnvFile         []string
	Environment     map[string]string
	Essential       bool
	Expose          []int
	Fetch           []*Fetch       // TODO make a struct
	HealthChecks    []*HealthCheck // TODO make a struct
	Hostname        string
	Image           string
	Labels          map[string]string
	Links           []string
	Logging         *Logging
	Memory          int // in bytes
	Name            string
	Network         []string
	NetworkMode     string
	Pid             string
	PortMappings    *PortMappings
	Privileged      bool
	PullImagePolicy string
	Replicas        int
	StopSignal      string
	User            string
	Volumes         *IntermediateVolumes
	VolumesFrom     []string // todo make a struct
	WorkDir         string
}

Container represents the intermediate format in between input and output formats

type Containers

type Containers []Container

Containers is for storing and sorting slices of Container

func (Containers) Len

func (cs Containers) Len() int

func (Containers) Less

func (cs Containers) Less(i, j int) bool

func (Containers) Swap

func (cs Containers) Swap(i, j int)

type Fetch

type Fetch struct {
	URI string
}

Fetch is an intermediate representation for fetching information

type HealthCheck

type HealthCheck struct {
	Exec string

	HTTPPath string
	Port     int
	Host     string
	Scheme   string
	Headers  map[string]string

	Interval         int
	Timeout          int
	FailureThreshold int
}

HealthCheck is an intermediate representation for health check information

type InputFormat

type InputFormat interface {
	IngestContainers(input io.ReadCloser) (*PodData, error)
}

InputFormat is an interface for other container formats to ingest containers

type IntermediateVolume

type IntermediateVolume struct {
	Host         string
	Container    string
	SourceVolume string
	ReadOnly     bool
}

IntermediateVolume is an intermediate representation for volume information

type IntermediateVolumes

type IntermediateVolumes []IntermediateVolume

IntermediateVolumes is a composite type for slices of IntermediateVolume

func (IntermediateVolumes) Len

func (iv IntermediateVolumes) Len() int

func (IntermediateVolumes) Less

func (iv IntermediateVolumes) Less(i, j int) bool

func (IntermediateVolumes) Swap

func (iv IntermediateVolumes) Swap(i, j int)

type Logging

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

Logging is an intermediate representation for logging information

type OutputFormat

type OutputFormat interface {
	EmitContainers(input *PodData) ([]byte, error)
}

OutputFormat is an interface for other container formats to emit containers

type PodData

type PodData struct {
	Name         string
	Containers   *Containers
	GlobalLabels map[string]string
	HostNetwork  bool
	HostPID      bool
	Replicas     int
}

PodData is the intermediary between each container format

type PortMapping

type PortMapping struct {
	HostIP        string
	HostPort      int
	ContainerIP   string
	ContainerPort int
	Protocol      string
	Name          string
}

PortMapping is an intermediate representation for port mapping information

type PortMappings

type PortMappings []PortMapping

PortMappings is a composite type for slices of PortMapping

func (PortMappings) Len

func (pm PortMappings) Len() int

func (PortMappings) Less

func (pm PortMappings) Less(i, j int) bool

func (PortMappings) Swap

func (pm PortMappings) Swap(i, j int)

Jump to

Keyboard shortcuts

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