model

package
v0.7.1-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2019 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

View Source
const (
	MOUNT_TYPE_VOLUME = MountType("volume")
	MOUNT_TYPE_BIND   = MountType("bind")
	MOUNT_TYPE_TMPFS  = MountType("tmpfs")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

type Check struct {
	Command []string `json:"cmd"`
	//Http     string        `json:"http"`
	Interval *time.Duration `json:"interval"`
	Timeout  *time.Duration `json:"timeout"`
	Retries  uint           `json:"retries,omitempty"`
	Disable  bool           `json:"disable,omitempty"`
}

type CompoundServices

type CompoundServices struct {
	Dir      string             `json:"-"`
	Services map[string]Service `json:"services"`
	Volumes  map[string]Volume  `json:"volumes,omitempty"`
}

func FromJSON

func FromJSON(b []byte) (r CompoundServices, err error)

func (*CompoundServices) JSON

func (c *CompoundServices) JSON() string

type ExtraHost

type ExtraHost struct {
	Name string `json:"name"`
	Ip   string `json:"ip"`
}

type ImageBuild

type ImageBuild struct {
	Context    string            `json:"context,omitempty"`
	Dockerfile string            `json:"dockerfile,omitempty"`
	Args       map[string]string `json:"args,omitempty"`
}

type MountType

type MountType string

type NetConf

type NetConf struct {
	Hostname   string        `json:"hostname,omitempty"`
	Domainname string        `json:"domainname,omitempty"`
	Dns        []string      `json:"dns,omitempty"`
	DnsSearch  []string      `json:"dns_search,omitempty"`
	DnsOptions []string      `json:"dns_options,omitempty"`
	ExtraHosts []ExtraHost   `json:"extra_hosts,omitempty"`
	Ports      []PortBinding `json:"ports,omitempty"`
	Networks   []string      `json:"networks,omitempty"`
}

type PathResolver

type PathResolver interface {
	ResolveFile(string) string
}

func NewPathResolver

func NewPathResolver(baseDir string) PathResolver

type PortBinding

type PortBinding struct {
	Target    uint16 `json:"target"`
	Published uint16 `json:"published,omitempty"`
	Protocol  string `json:"protocol,omitempty"`
	IP        string `json:"ip,omitempty"`
}

func (PortBinding) String

func (p PortBinding) String() string

type Process

type Process struct {
	Entrypoint  []string          `json:"entrypoint,omitempty"`
	Command     []string          `json:"command,omitempty"`
	PRoot       bool              `json:"proot,omitempty"`
	Cwd         string            `json:"working_dir,omitempty"`
	Environment map[string]string `json:"environment,omitempty"`
	User        *User             `json:"user,omitempty"`
	Privileged  bool              `json:"privileged",omitempty"`
	CapAdd      []string          `json:"cap_add,omitempty"`
	CapDrop     []string          `json:"cap_drop,omitempty"`
	StdinOpen   bool              `json:"stdin_open,omitempty"`
	Tty         bool              `json:"tty,omitempty"`

	// TODO: expose in CLI
	ApparmorProfile string `json:"app_armor_profile,omitempty"`
	SelinuxLabel    string `json:"process_label,omitempty"`
	NoNewPrivileges bool   `json:"no_new_privileges,omitempty"`
	OOMScoreAdj     *int   `json:"oom_score_adj,omitempty"`
}

type ResourceResolver

type ResourceResolver interface {
	PathResolver
	ResolveMountSource(VolumeMount) (string, error)
}

func NewResourceResolver

func NewResourceResolver(paths PathResolver, vols map[string]Volume) ResourceResolver

type Rlimit

type Rlimit struct {
	Type string `json:"type"`
	Hard uint64 `json:"hard"`
	Soft uint64 `json:"soft"`
}

type Service

type Service struct {
	Name         string `json:"-"`
	Bundle       string `json:"bundle,omitempty"`
	BundleUpdate bool   `json:"bundle_update,omitempty"`
	NoPivot      bool   `json:"no_pivot,omitempty"`
	NoNewKeyring bool   `json:"no_new_keyring,omitempty"`

	Image string      `json:"image,omitempty"`
	Build *ImageBuild `json:"build,omitempty"`
	Process
	Seccomp      string `json:"seccomp,omitempty"`
	MountCgroups string `json:"cgroups_mount_option,omitempty"` // Not read from compose file. TODO: move to CLI only
	NetConf
	ReadOnly bool          `json:"read_only,omitempty"`
	Expose   []string      `json:"expose,omitempty"`
	Volumes  []VolumeMount `json:"volumes,omitempty"`
	// TODO: handle check
	HealthCheck     *Check         `json:"healthcheck,omitempty"`
	StopSignal      string         `json:"stop_signal,omitempty"`
	StopGracePeriod *time.Duration `json:"stop_grace_period,omitempty"`
}

func NewService

func NewService(name string) Service

func (*Service) JSON

func (c *Service) JSON() string

type User

type User struct {
	User  string `json:"uid,omitempty"`
	Group string `json:"gid,omitempty"`
	// TODO: expose in CLI
	AdditionalGroups []string `json:"additional_groups,omitempty"`
}

type Volume

type Volume struct {
	Source   string `json:"source,omitempty"`
	External string `json:"external,omitempty"` // Name of an external volume
}

type VolumeMount

type VolumeMount struct {
	Type    MountType `json:"type,omitempty"`
	Source  string    `json:"source,omitempty"`
	Target  string    `json:"target,omitempty"`
	Options []string  `json:"options,omitempty"`
}

func (VolumeMount) IsNamedVolume

func (m VolumeMount) IsNamedVolume() bool

func (VolumeMount) String

func (m VolumeMount) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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