crane: github.com/michaelsauter/crane/crane Index | Files

package crane

import "github.com/michaelsauter/crane/crane"

Index

Package Files

accelerated_mount_basic.go build_parameters.go cli.go config.go container.go containers.go crane.go dependencies.go healthcheck_parameters.go hooks.go logging_parameters.go network.go network_parameters.go settings.go target.go unit_of_work.go update.go version_basic.go volume.go

Constants

const Pro = false
const Version = "3.4.2"

func RealMain Uses

func RealMain()

type AcceleratedMount Uses

type AcceleratedMount interface {
    Run()
    Reset()
    Logs(follow bool)
    VolumeArg() string
    Volume() string
}

type AcceleratedMountMap Uses

type AcceleratedMountMap map[string]AcceleratedMount

type BuildParameters Uses

type BuildParameters struct {
    RawContext    string      `json:"context" yaml:"context"`
    RawFile       string      `json:"file" yaml:"file"`
    RawDockerfile string      `json:"dockerfile" yaml:"dockerfile"`
    RawBuildArgs  interface{} `json:"build-arg" yaml:"build-arg"`
    RawArgs       interface{} `json:"args" yaml:"args"`
}

func (BuildParameters) BuildArgs Uses

func (b BuildParameters) BuildArgs() []string

func (BuildParameters) Context Uses

func (b BuildParameters) Context() string

func (BuildParameters) File Uses

func (b BuildParameters) File() string

type Config Uses

type Config interface {
    DependencyMap() map[string]*Dependencies
    ContainersForReference(reference string) (result []string)
    Path() string
    UniqueID() string
    Prefix() string
    Tag() string
    NetworkNames() []string
    VolumeNames() []string
    Cmds() map[string][]string
    AcceleratedMountNames() []string
    Network(name string) Network
    Volume(name string) Volume
    Cmd(name string) []string
    AcceleratedMount(volume string) AcceleratedMount
    ContainerMap() ContainerMap
    Container(name string) Container
    ContainerInfo(name string) ContainerInfo
}

func NewConfig Uses

func NewConfig(files []string, prefix string, tag string) Config

NewConfig retus a new config based on given location. Containers will be ordered so that they can be brought up and down with Docker.

type Container Uses

type Container interface {
    ContainerInfo
    Exists() bool
    Running() bool
    Paused() bool
    Status() [][]string
    Provision(nocache bool)
    PullImage()
    Create(cmds []string)
    Run(cmds []string, targeted bool, detachFlag bool)
    Start(targeted bool)
    Kill()
    Stop()
    Pause()
    Unpause()
    Exec(cmds []string, privileged bool, user string)
    Rm(force bool, volumes bool)
    Logs(follow bool, since string, tail string) (sources []LogSource)
    Push()
    SetCommandsOutput(stdout, stderr io.Writer)
    CommandsOut() io.Writer
    CommandsErr() io.Writer
    BindMounts(volumeNames []string) []string
    VolumeSources() []string
    Net() string
    Networks() map[string]NetworkParameters
}

type ContainerInfo Uses

type ContainerInfo interface {
    Name() string
    PrefixedName() string
    ActualName(bool) string
    Image() string
    ID() string
    Dependencies() *Dependencies
    BuildParams() BuildParameters
    Hooks() Hooks
}

type ContainerMap Uses

type ContainerMap map[string]Container

ContainerMap maps the container name to its configuration

type Containers Uses

type Containers []Container

func (Containers) Logs Uses

func (containers Containers) Logs(follow bool, timestamps bool, tail string, colorize bool, since string)

Dump container logs.

func (Containers) Provision Uses

func (containers Containers) Provision(nocache bool, parallel int)

Provision containers.

func (Containers) Reversed Uses

func (containers Containers) Reversed() Containers

func (Containers) Status Uses

func (containers Containers) Status(notrunc bool)

Status of containers.

type Dependencies Uses

type Dependencies struct {
    All         []string
    Requires    []string
    Link        []string
    VolumesFrom []string
    Net         string
    IPC         string
}

Dependencies contains 4 fields: all: contains all dependencies requires: containers that need to be running link: containers linked to volumesFrom: containers that provide volumes net: container the net stack is shared with

type HealthcheckParameters Uses

type HealthcheckParameters struct {
    RawTest     string `json:"test" yaml:"test"`
    RawInterval string `json:"interval" yaml:"interval"`
    RawTimeout  string `json:"timeout" yaml:"timeout"`
    Retries     int    `json:"retries" yaml:"retries"`
    Disable     bool   `json:"disable" yaml:"disable"`
}

func (HealthcheckParameters) Interval Uses

func (h HealthcheckParameters) Interval() string

func (HealthcheckParameters) Test Uses

func (h HealthcheckParameters) Test() string

func (HealthcheckParameters) Timeout Uses

func (h HealthcheckParameters) Timeout() string

type Hooks Uses

type Hooks interface {
    PreBuild() string
    PostBuild() string
    PreStart() string
    PostStart() string
    PreStop() string
    PostStop() string
}

type LogSource Uses

type LogSource struct {
    Stdout io.Reader
    Stderr io.Reader
    Name   string
}

type LoggingParameters Uses

type LoggingParameters struct {
    RawDriver  string      `json:"driver" yaml:"driver"`
    RawOptions interface{} `json:"options" yaml:"options"`
}

func (LoggingParameters) Driver Uses

func (l LoggingParameters) Driver() string

func (LoggingParameters) Options Uses

func (l LoggingParameters) Options() []string

type Network Uses

type Network interface {
    Name() string
    Subnet() string
    ActualName() string
    Create()
    Exists() bool
}

type NetworkMap Uses

type NetworkMap map[string]Network

type NetworkParameters Uses

type NetworkParameters struct {
    RawAlias       interface{} `json:"alias" yaml:"alias"`
    RawAliases     interface{} `json:"aliases" yaml:"aliases"`
    RawIp          string      `json:"ip" yaml:"ip"`
    RawIpv4Address string      `json:"ipv4_address" yaml:"ipv4_address"`
    RawIp6         string      `json:"ip6" yaml:"ip6"`
    RawIpv6Address string      `json:"ipv6_address" yaml:"ipv6_address"`
}

func (NetworkParameters) Alias Uses

func (n NetworkParameters) Alias(containerName string) []string

If aliases are not defined in the config, the container name is added as a default alias. When an empty array is configured, no default alias is used.

func (NetworkParameters) Ip Uses

func (n NetworkParameters) Ip() string

func (NetworkParameters) Ip6 Uses

func (n NetworkParameters) Ip6() string

type OptBool Uses

type OptBool struct {
    Defined bool
    Value   bool
}

func (OptBool) Falsy Uses

func (o OptBool) Falsy() bool

func (OptBool) Truthy Uses

func (o OptBool) Truthy() bool

func (*OptBool) UnmarshalJSON Uses

func (o *OptBool) UnmarshalJSON(b []byte) (err error)

func (*OptBool) UnmarshalYAML Uses

func (o *OptBool) UnmarshalYAML(unmarshal func(interface{}) error) error

type OptInt Uses

type OptInt struct {
    Defined bool
    Value   int
}

func (*OptInt) UnmarshalJSON Uses

func (o *OptInt) UnmarshalJSON(b []byte) (err error)

func (*OptInt) UnmarshalYAML Uses

func (o *OptInt) UnmarshalYAML(unmarshal func(interface{}) error) error

type Settings Uses

type Settings struct {
    UUID            string    `json:"uuid"`
    Version         string    `json:"version"`
    LatestVersion   string    `json:"latest_version"`
    NextUpdateCheck time.Time `json:"next_update_check"`
    CheckForUpdates bool      `json:"check_for_updates"`
    // contains filtered or unexported fields
}

func (*Settings) CorrectVersion Uses

func (s *Settings) CorrectVersion() error

If version in settings does not match version of binary, we assume that the binary was updated and update the settings file with the new information.

func (*Settings) DelayNextUpdateCheck Uses

func (s *Settings) DelayNextUpdateCheck() error

func (*Settings) ShouldCheckForUpdates Uses

func (s *Settings) ShouldCheckForUpdates() bool

func (*Settings) Update Uses

func (s *Settings) Update(latestVersion string) error

func (*Settings) Write Uses

func (s *Settings) Write(filename string) error

type StatusError Uses

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

type Target Uses

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

func NewTarget Uses

func NewTarget(dependencyMap map[string]*Dependencies, targetArg string, extendFlag bool) (target Target, err error)

NewTarget receives the specified target and determines which containers should be targeted. The target might be extended to dependencies if --extend is given. Additionally, the target is sorted alphabetically.

type UnitOfWork Uses

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

func NewUnitOfWork Uses

func NewUnitOfWork(dependencyMap map[string]*Dependencies, targeted []string) (uow *UnitOfWork, err error)

func (*UnitOfWork) Associated Uses

func (uow *UnitOfWork) Associated() []string

func (*UnitOfWork) Containers Uses

func (uow *UnitOfWork) Containers() Containers

func (*UnitOfWork) Create Uses

func (uow *UnitOfWork) Create(cmds []string)

Create containers.

func (*UnitOfWork) Exec Uses

func (uow *UnitOfWork) Exec(cmds []string, privileged bool, user string)

func (*UnitOfWork) Generate Uses

func (uow *UnitOfWork) Generate(templateFile string, output string)

Generate files.

func (*UnitOfWork) Kill Uses

func (uow *UnitOfWork) Kill()

Kill containers.

func (*UnitOfWork) Logs Uses

func (uow *UnitOfWork) Logs(follow bool, timestamps bool, tail string, colorize bool, since string)

Log containers.

func (*UnitOfWork) Pause Uses

func (uow *UnitOfWork) Pause()

Pause containers.

func (*UnitOfWork) Provision Uses

func (uow *UnitOfWork) Provision(noCache bool, parallel int)

Provision containers.

func (*UnitOfWork) PullImage Uses

func (uow *UnitOfWork) PullImage()

Pull containers.

func (*UnitOfWork) Push Uses

func (uow *UnitOfWork) Push()

Push containers.

func (*UnitOfWork) RequiredNetworks Uses

func (uow *UnitOfWork) RequiredNetworks() []string

func (*UnitOfWork) RequiredVolumes Uses

func (uow *UnitOfWork) RequiredVolumes() []string

func (*UnitOfWork) Rm Uses

func (uow *UnitOfWork) Rm(force bool, volumes bool)

Rm containers.

func (*UnitOfWork) Run Uses

func (uow *UnitOfWork) Run(cmds []string, detach bool)

func (*UnitOfWork) Start Uses

func (uow *UnitOfWork) Start()

Start containers.

func (*UnitOfWork) Stats Uses

func (uow *UnitOfWork) Stats(noStream bool)

func (*UnitOfWork) Status Uses

func (uow *UnitOfWork) Status(noTrunc bool)

func (*UnitOfWork) Stop Uses

func (uow *UnitOfWork) Stop()

Stop containers.

func (*UnitOfWork) Targeted Uses

func (uow *UnitOfWork) Targeted() Containers

func (*UnitOfWork) TargetedInfo Uses

func (uow *UnitOfWork) TargetedInfo() []ContainerInfo

func (*UnitOfWork) Unpause Uses

func (uow *UnitOfWork) Unpause()

Unpause containers.

func (*UnitOfWork) Up Uses

func (uow *UnitOfWork) Up(cmds []string, detach bool, noCache bool, parallel int)

type UpdateRequestParams Uses

type UpdateRequestParams struct {
    UUID    string `json:"uuid"`
    Arch    string `json:"arch"`
    OS      string `json:"os"`
    Version string `json:"version"`
    Pro     bool   `json:"pro"`
}

type UpdateResponseBody Uses

type UpdateResponseBody struct {
    Outdated              bool   `json:"outdated"`
    LatestVersion         string `json:"latest_version"`
    LatestReleaseDate     string `json:"latest_release_date"`
    LatestInstallationUrl string `json:"latest_installation_url"`
    LatestChangelogUrl    string `json:"latest_changelog_url"`
}

type Volume Uses

type Volume interface {
    Name() string
    ActualName() string
    Create()
    Exists() bool
}

type VolumeMap Uses

type VolumeMap map[string]Volume

Package crane imports 28 packages (graph) and is imported by 4 packages. Updated 2018-07-28. Refresh now. Tools for package owners.