rainbond: github.com/goodrain/rainbond/builder/parser/compose Index | Files

package compose

import "github.com/goodrain/rainbond/builder/parser/compose"


Package Files

compose.go compose_object.go utils.go version12.go version3.go

func ParseVolume Uses

func ParseVolume(volume string) (name, host, container, mode string, err error)

ParseVolume parses a given volume, which might be [name:][host:]container[:access_mode]

type Compose Uses

type Compose struct {

Compose is docker compose file loader, implements Loader interface

func (*Compose) LoadBytes Uses

func (c *Compose) LoadBytes(bodys [][]byte) (ComposeObject, error)

LoadBytes loads a compose file byte into KomposeObject

type ComposeObject Uses

type ComposeObject struct {
    ServiceConfigs map[string]ServiceConfig

ComposeObject holds the generic struct of Kompose transformation

type ConvertOptions Uses

type ConvertOptions struct {
    ToStdout                    bool
    CreateD                     bool
    CreateRC                    bool
    CreateDS                    bool
    CreateDeploymentConfig      bool
    BuildRepo                   string
    BuildBranch                 string
    Build                       string
    CreateChart                 bool
    GenerateYaml                bool
    GenerateJSON                bool
    EmptyVols                   bool
    Volumes                     string
    InsecureRepository          bool
    Replicas                    int
    InputFiles                  []string
    OutFile                     string
    Provider                    string
    Namespace                   string
    Controller                  string
    IsDeploymentFlag            bool
    IsDaemonSetFlag             bool
    IsReplicationControllerFlag bool
    IsReplicaSetFlag            bool
    IsDeploymentConfigFlag      bool
    IsNamespaceFlag             bool

ConvertOptions holds all options that controls transformation process

type EnvVar Uses

type EnvVar struct {
    Name  string
    Value string

EnvVar holds the environment variable struct of a container

type HealthCheck Uses

type HealthCheck struct {
    Test        []string
    Timeout     int32
    Interval    int32
    Retries     int32
    StartPeriod int32
    Disable     bool

HealthCheck the healthcheck configuration for a service "StartPeriod" is not yet added to compose, see: https://github.com/docker/cli/issues/116

type Ports Uses

type Ports struct {
    HostPort      int32
    ContainerPort int32
    HostIP        string
    Protocol      string

Ports holds the ports struct of a container

type ServiceConfig Uses

type ServiceConfig struct {
    ContainerName    string
    Image            string              `compose:"image"`
    Environment      []EnvVar            `compose:"environment"`
    EnvFile          []string            `compose:"env_file"`
    Port             []Ports             `compose:"ports"`
    Command          []string            `compose:"command"`
    DependsON        []string            `compose:"depends_on"`
    Links            []string            `compose:"links"`
    WorkingDir       string              `compose:""`
    Args             []string            `compose:"args"`
    VolList          []string            `compose:"volumes"`
    Network          []string            `compose:"network"`
    Labels           map[string]string   `compose:"labels"`
    Annotations      map[string]string   `compose:""`
    CPUSet           string              `compose:"cpuset"`
    CPUShares        int64               `compose:"cpu_shares"`
    CPUQuota         int64               `compose:"cpu_quota"`
    CPULimit         int64               `compose:""`
    CPUReservation   int64               `compose:""`
    CapAdd           []string            `compose:"cap_add"`
    CapDrop          []string            `compose:"cap_drop"`
    Expose           []string            `compose:"expose"`
    Pid              string              `compose:"pid"`
    Privileged       bool                `compose:"privileged"`
    Restart          string              `compose:"restart"`
    User             string              `compose:"user"`
    VolumesFrom      []string            `compose:"volumes_from"`
    ServiceType      string              `compose:"kompose.service.type"`
    StopGracePeriod  string              `compose:"stop_grace_period"`
    Build            string              `compose:"build"`
    BuildArgs        map[string]*string  `compose:"build-args"`
    ExposeService    string              `compose:"kompose.service.expose"`
    ExposeServiceTLS string              `compose:"kompose.service.expose.tls-secret"`
    Stdin            bool                `compose:"stdin_open"`
    Tty              bool                `compose:"tty"`
    MemLimit         yaml.MemStringorInt `compose:"mem_limit"`
    MemReservation   yaml.MemStringorInt `compose:""`
    DeployMode       string              `compose:""`
    TmpFs            []string            `compose:"tmpfs"`
    Dockerfile       string              `compose:"dockerfile"`
    Replicas         int                 `compose:"replicas"`
    GroupAdd         []int64             `compose:"group_add"`
    Volumes          []Volumes           `compose:""`
    HealthChecks     HealthCheck         `compose:""`
    Placement        map[string]string   `compose:""`

ServiceConfig holds the basic struct of a container

type Volumes Uses

type Volumes struct {
    SvcName    string // Service name to which volume is linked
    MountPath  string // Mountpath extracted from docker-compose file
    VFrom      string // denotes service name from which volume is coming
    VolumeName string // name of volume if provided explicitly
    Host       string // host machine address
    Container  string // Mountpath
    Mode       string // access mode for volume
    PVCName    string // name of PVC
    PVCSize    string // PVC size

Volumes holds the volume struct of container

func ParseVols Uses

func ParseVols(volNames []string, svcName string) ([]Volumes, error)

Package compose imports 17 packages (graph) and is imported by 1 packages. Updated 2019-04-21. Refresh now. Tools for package owners.