model

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoolVal

type BoolVal string

func (BoolVal) MarshalJSON

func (b BoolVal) MarshalJSON() ([]byte, error)

func (*BoolVal) UnmarshalJSON

func (b *BoolVal) UnmarshalJSON(v []byte) error

type Descriptors

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

func NewDescriptors

func NewDescriptors(defaultVolumeBaseDir string) *Descriptors

func (*Descriptors) Descriptor

func (self *Descriptors) Descriptor(file string) (r *PodDescriptor, err error)

type HealthCheckDescriptor

type HealthCheckDescriptor struct {
	Command  []string  `json:"cmd,omitempty"`
	Http     string    `json:"http,omitempty"`
	Interval string    `json:"interval,omitempty"`
	Timeout  string    `json:"timeout,omitempty"`
	Retries  NumberVal `json:"retries,omitempty"`
	Disable  BoolVal   `json:"disable,omitempty"`
}

type ImageMetadata

type ImageMetadata struct {
	Name             string
	Exec             []string
	WorkingDirectory string
	MountPoints      map[string]string
	Ports            map[string]*ImagePort
	Environment      map[string]string
}

type ImagePort

type ImagePort struct {
	Protocol string `json:"protocol"`
	Port     uint16 `json:"port"`
}

type Images

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

func NewImages

func NewImages(pullPolicy PullPolicy, fetchAs *UserGroup, debug log.Logger) *Images

func (*Images) BuildImage

func (self *Images) BuildImage(name, dockerFile, contextPath string) (img *ImageMetadata, err error)

func (*Images) Image

func (self *Images) Image(name string) (*ImageMetadata, error)

type NumberVal

type NumberVal string

func (NumberVal) MarshalJSON

func (n NumberVal) MarshalJSON() ([]byte, error)

func (*NumberVal) UnmarshalJSON

func (n *NumberVal) UnmarshalJSON(v []byte) error

type PodDescriptor

type PodDescriptor struct {
	File                      string                        `json:"-"`
	Version                   uint8                         `json:"version"`
	Name                      string                        `json:"name,omitempty"`
	Net                       []string                      `json:"net,omitempty"`
	Dns                       []string                      `json:"dns,omitempty"`
	DnsSearch                 []string                      `json:"dns_search,omitempty"`
	Hostname                  string                        `json:"hostname,omitempty"`
	Domainname                string                        `json:"domainname,omitempty"`
	DisableHostsInjection     BoolVal                       `json:"disable_hosts_injection,omitempty"`
	Environment               map[string]string             `json:"environment,omitempty"`
	Services                  map[string]*ServiceDescriptor `json:"services"`
	Volumes                   map[string]*VolumeDescriptor  `json:"volumes,omitempty"`
	SharedKeys                map[string]string             `json:"shared_keys,omitempty"`
	SharedKeysOverrideAllowed BoolVal                       `json:"shared_keys_overridable,omitempty"`
	StopGracePeriod           string                        `json:"stop_grace_period,omitempty"`
}

func NewPodDescriptor

func NewPodDescriptor() *PodDescriptor

func (*PodDescriptor) JSON

func (d *PodDescriptor) JSON() string

type PortBindingDescriptor

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

type PullPolicy

type PullPolicy string
const (
	PULL_NEVER  PullPolicy = "never"
	PULL_NEW    PullPolicy = "new"
	PULL_UPDATE PullPolicy = "update"
)

type ServiceBuildDescriptor

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

type ServiceDescriptor

type ServiceDescriptor struct {
	Extends     *ServiceDescriptorExtension `json:"extends,omitempty"`
	Image       string                      `json:"image,omitempty"`
	Build       *ServiceBuildDescriptor     `json:"build,omitempty"`
	Entrypoint  []string                    `json:"entrypoint,omitempty"`
	Command     []string                    `json:"command,omitempty"`
	EnvFile     []string                    `json:"env_file,omitempty"`
	Environment map[string]string           `json:"environment,omitempty"`
	HealthCheck *HealthCheckDescriptor      `json:"healthcheck,omitempty"`
	Ports       []*PortBindingDescriptor    `json:"ports,omitempty"`
	Mounts      map[string]string           `json:"mounts,omitempty"`
}

type ServiceDescriptorExtension

type ServiceDescriptorExtension struct {
	File    string `json:"file"`
	Service string `json:"service"`
}

type UserGroup

type UserGroup struct {
	Uid uint32
	Gid uint32
}

type VolumeDescriptor

type VolumeDescriptor struct {
	Source   string  `json:"source"`
	Kind     string  `json:"kind,omitempty"`
	Readonly BoolVal `json:"readonly,omitempty"`
}

Jump to

Keyboard shortcuts

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