spec: github.com/appc/spec/schema/types Index | Files | Directories

package types

import "github.com/appc/spec/schema/types"

Package types contains structs representing the various types in the app container specification. It is used by the [schema manifest types](../) to enforce validation.

Index

Package Files

acidentifier.go ackind.go acname.go annotations.go app.go date.go dependencies.go doc.go environment.go errors.go event_handler.go exec.go hash.go isolator.go isolator_linux_specific.go isolator_resources.go isolator_unix.go labels.go mountpoint.go port.go semver.go url.go user_annotations.go user_labels.go uuid.go volume.go

Constants

const (
    LinuxCapabilitiesRetainSetName = "os/linux/capabilities-retain-set"
    LinuxCapabilitiesRevokeSetName = "os/linux/capabilities-remove-set"
    LinuxNoNewPrivilegesName       = "os/linux/no-new-privileges"
    LinuxSeccompRemoveSetName      = "os/linux/seccomp-remove-set"
    LinuxSeccompRetainSetName      = "os/linux/seccomp-retain-set"
    LinuxOOMScoreAdjName           = "os/linux/oom-score-adj"
    LinuxCPUSharesName             = "os/linux/cpu-shares"
    LinuxSELinuxContextName        = "os/linux/selinux-context"
    LinuxAppArmorProfileName       = "os/linux/apparmor-profile"
)
const (
    ResourceBlockBandwidthName   = "resource/block-bandwidth"
    ResourceBlockIOPSName        = "resource/block-iops"
    ResourceCPUName              = "resource/cpu"
    ResourceMemoryName           = "resource/memory"
    ResourceNetworkBandwidthName = "resource/network-bandwidth"
)
const (
    //TODO(lucab): add "ulimit" isolators
    UnixSysctlName = "os/unix/sysctl"
)

Variables

var (
    // ValidACIdentifier is a regular expression that defines a valid ACIdentifier
    ValidACIdentifier = regexp.MustCompile("^[a-z0-9]+([-._~/][a-z0-9]+)*$")

    ErrEmptyACIdentifier         = ACIdentifierError("ACIdentifier cannot be empty")
    ErrInvalidEdgeInACIdentifier = ACIdentifierError("ACIdentifier must start and end with only lower case " +
        "alphanumeric characters")
    ErrInvalidCharInACIdentifier = ACIdentifierError("ACIdentifier must contain only lower case " +
        `alphanumeric characters plus "-._~/"`)
)
var (
    // ValidACName is a regular expression that defines a valid ACName
    ValidACName = regexp.MustCompile("^[a-z0-9]+([-][a-z0-9]+)*$")

    ErrEmptyACName         = ACNameError("ACName cannot be empty")
    ErrInvalidEdgeInACName = ACNameError("ACName must start and end with only lower case " +
        "alphanumeric characters")
    ErrInvalidCharInACName = ACNameError("ACName must contain only lower case " +
        `alphanumeric characters plus "-"`)
)
var (

    // ErrIncompatibleIsolator is returned whenever an Isolators set contains
    // conflicting IsolatorValue instances
    ErrIncompatibleIsolator = errors.New("isolators set contains incompatible types")
    // ErrInvalidIsolator is returned upon validation failures due to improper
    // or partially constructed Isolator instances (eg. from incomplete direct construction)
    ErrInvalidIsolator = errors.New("invalid isolator")
)
var (
    ErrDefaultTrue     = errors.New("default must be false")
    ErrDefaultRequired = errors.New("default must be true")
    ErrRequestNonEmpty = errors.New("request not supported by this resource, must be empty")

    ResourceIsolatorNames = make(map[ACIdentifier]struct{})
)
var (
    ErrNoZeroSemVer = ACVersionError("SemVer cannot be zero")
    ErrBadSemVer    = ACVersionError("SemVer is bad")
)
var (
    ErrNoACKind = ACKindError("ACKind must be set")
)
var (
    ErrNoEmptyUUID = errors.New("UUID cannot be empty")
)
var LinuxIsolatorNames = make(map[ACIdentifier]struct{})
var (
    UnixIsolatorNames = make(map[ACIdentifier]struct{})
)
var ValidOSArch = map[string][]string{
    "linux":   {"amd64", "i386", "aarch64", "aarch64_be", "armv6l", "armv7l", "armv7b", "ppc64", "ppc64le", "s390x"},
    "freebsd": {"amd64", "i386", "arm"},
    "darwin":  {"x86_64", "i386"},
}

func AddIsolatorName Uses

func AddIsolatorName(n ACIdentifier, ns map[ACIdentifier]struct{})

func AddIsolatorValueConstructor Uses

func AddIsolatorValueConstructor(n ACIdentifier, i IsolatorValueConstructor)

func IsValidOSArch Uses

func IsValidOSArch(labels map[ACIdentifier]string, validOSArch map[string][]string) error

IsValidOsArch checks if a OS-architecture combination is valid given a map of valid OS-architectures

func SanitizeACIdentifier Uses

func SanitizeACIdentifier(s string) (string, error)

SanitizeACIdentifier replaces every invalid ACIdentifier character in s with an underscore making it a legal ACIdentifier string. If the character is an upper case letter it replaces it with its lower case. It also removes illegal edge characters (hyphens, period, underscore, tilde and slash).

This is a helper function and its algorithm is not part of the spec. It should not be called without the user explicitly asking for a suggestion.

func SanitizeACName Uses

func SanitizeACName(s string) (string, error)

SanitizeACName replaces every invalid ACName character in s with a dash making it a legal ACName string. If the character is an upper case letter it replaces it with its lower case. It also removes illegal edge characters (hyphens).

This is a helper function and its algorithm is not part of the spec. It should not be called without the user explicitly asking for a suggestion.

func ShortHash Uses

func ShortHash(hash string) string

func ToAppcOSArch Uses

func ToAppcOSArch(goOs string, goArch string, goArchFlavor string) (appcOs string, appcArch string, e error)

ToAppcOSArch translates a Golang arch tuple (OS, architecture, flavor) into an appc arch tuple (OS, architecture)

func ToGoOSArch Uses

func ToGoOSArch(appcOs string, appcArch string) (goOs string, goArch string, goArchFlavor string, e error)

ToGoOSArch translates an appc arch tuple (OS, architecture) into a Golang arch tuple (OS, architecture, flavor)

type ACIdentifier Uses

type ACIdentifier string

ACIdentifier (an App-Container Identifier) is a format used by keys in image names and image labels of the App Container Standard. An ACIdentifier is restricted to numeric and lowercase URI unreserved characters defined in URI RFC[1]; all alphabetical characters must be lowercase only. Furthermore, the first and last character ("edges") must be alphanumeric, and an ACIdentifier cannot be empty. Programmatically, an ACIdentifier must conform to the regular expression ValidACIdentifier.

[1] http://tools.ietf.org/html/rfc3986#section-2.3

func MustACIdentifier Uses

func MustACIdentifier(s string) *ACIdentifier

MustACIdentifier generates a new ACIdentifier from a string, If the given string is not a valid ACIdentifier, it panics.

func NewACIdentifier Uses

func NewACIdentifier(s string) (*ACIdentifier, error)

NewACIdentifier generates a new ACIdentifier from a string. If the given string is not a valid ACIdentifier, nil and an error are returned.

func (ACIdentifier) Empty Uses

func (n ACIdentifier) Empty() bool

Empty returns a boolean indicating whether this ACIdentifier is empty.

func (ACIdentifier) Equals Uses

func (n ACIdentifier) Equals(o ACIdentifier) bool

Equals checks whether a given ACIdentifier is equal to this one.

func (ACIdentifier) MarshalJSON Uses

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

MarshalJSON implements the json.Marshaler interface

func (*ACIdentifier) Set Uses

func (n *ACIdentifier) Set(s string) error

Set sets the ACIdentifier to the given value, if it is valid; if not, an error is returned.

func (ACIdentifier) String Uses

func (n ACIdentifier) String() string

func (*ACIdentifier) UnmarshalJSON Uses

func (n *ACIdentifier) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface

type ACIdentifierError Uses

type ACIdentifierError string

An ACIdentifierError is returned when a bad value is used for an ACIdentifier

func (ACIdentifierError) Error Uses

func (e ACIdentifierError) Error() string

type ACKind Uses

type ACKind string

ACKind wraps a string to define a field which must be set with one of several ACKind values. If it is unset, or has an invalid value, the field will refuse to marshal/unmarshal.

func (ACKind) MarshalJSON Uses

func (a ACKind) MarshalJSON() ([]byte, error)

func (ACKind) String Uses

func (a ACKind) String() string

func (*ACKind) UnmarshalJSON Uses

func (a *ACKind) UnmarshalJSON(data []byte) error

type ACKindError Uses

type ACKindError string

An ACKindError is returned when the wrong ACKind is set in a manifest

func InvalidACKindError Uses

func InvalidACKindError(kind ACKind) ACKindError

func (ACKindError) Error Uses

func (e ACKindError) Error() string

type ACName Uses

type ACName string

ACName (an App-Container Name) is a format used by keys in different formats of the App Container Standard. An ACName is restricted to numeric and lowercase characters accepted by the DNS RFC[1] plus "-"; all alphabetical characters must be lowercase only. Furthermore, the first and last character ("edges") must be alphanumeric, and an ACName cannot be empty. Programmatically, an ACName must conform to the regular expression ValidACName.

[1] http://tools.ietf.org/html/rfc1123#page-13

func MustACName Uses

func MustACName(s string) *ACName

MustACName generates a new ACName from a string, If the given string is not a valid ACName, it panics.

func NewACName Uses

func NewACName(s string) (*ACName, error)

NewACName generates a new ACName from a string. If the given string is not a valid ACName, nil and an error are returned.

func (ACName) Empty Uses

func (n ACName) Empty() bool

Empty returns a boolean indicating whether this ACName is empty.

func (ACName) Equals Uses

func (n ACName) Equals(o ACName) bool

Equals checks whether a given ACName is equal to this one.

func (ACName) MarshalJSON Uses

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

MarshalJSON implements the json.Marshaler interface

func (*ACName) Set Uses

func (n *ACName) Set(s string) error

Set sets the ACName to the given value, if it is valid; if not, an error is returned.

func (ACName) String Uses

func (n ACName) String() string

func (*ACName) UnmarshalJSON Uses

func (n *ACName) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface

type ACNameError Uses

type ACNameError string

An ACNameError is returned when a bad value is used for an ACName

func (ACNameError) Error Uses

func (e ACNameError) Error() string

type ACVersionError Uses

type ACVersionError string

An ACVersionError is returned when a bad ACVersion is set in a manifest

func (ACVersionError) Error Uses

func (e ACVersionError) Error() string

type Annotation Uses

type Annotation struct {
    Name  ACIdentifier `json:"name"`
    Value string       `json:"value"`
}

type Annotations Uses

type Annotations []Annotation

func (Annotations) Get Uses

func (a Annotations) Get(name string) (val string, ok bool)

Retrieve the value of an annotation by the given name from Annotations, if it exists.

func (Annotations) MarshalJSON Uses

func (a Annotations) MarshalJSON() ([]byte, error)

func (*Annotations) Set Uses

func (a *Annotations) Set(name ACIdentifier, value string)

Set sets the value of an annotation by the given name, overwriting if one already exists.

func (*Annotations) UnmarshalJSON Uses

func (a *Annotations) UnmarshalJSON(data []byte) error

type App Uses

type App struct {
    Exec              Exec            `json:"exec"`
    EventHandlers     []EventHandler  `json:"eventHandlers,omitempty"`
    User              string          `json:"user"`
    Group             string          `json:"group"`
    SupplementaryGIDs []int           `json:"supplementaryGIDs,omitempty"`
    WorkingDirectory  string          `json:"workingDirectory,omitempty"`
    Environment       Environment     `json:"environment,omitempty"`
    MountPoints       []MountPoint    `json:"mountPoints,omitempty"`
    Ports             []Port          `json:"ports,omitempty"`
    Isolators         Isolators       `json:"isolators,omitempty"`
    UserAnnotations   UserAnnotations `json:"userAnnotations,omitempty"`
    UserLabels        UserLabels      `json:"userLabels,omitempty"`
}

func (App) MarshalJSON Uses

func (a App) MarshalJSON() ([]byte, error)

func (*App) UnmarshalJSON Uses

func (a *App) UnmarshalJSON(data []byte) error

type AsIsolator Uses

type AsIsolator interface {
    AsIsolator() (*Isolator, error)
}

type Date Uses

type Date time.Time

Date wraps time.Time to marshal/unmarshal to/from JSON strings in strict accordance with RFC3339 TODO(jonboulle): golang's implementation seems slightly buggy here; according to http://tools.ietf.org/html/rfc3339#section-5.6 , applications may choose to separate the date and time with a space instead of a T character (for example, `date --rfc-3339` on GNU coreutils) - but this is considered an error by go's parser. File a bug?

func NewDate Uses

func NewDate(s string) (*Date, error)

func (Date) MarshalJSON Uses

func (d Date) MarshalJSON() ([]byte, error)

func (Date) String Uses

func (d Date) String() string

func (*Date) UnmarshalJSON Uses

func (d *Date) UnmarshalJSON(data []byte) error

type Dependencies Uses

type Dependencies []Dependency

type Dependency Uses

type Dependency struct {
    ImageName ACIdentifier `json:"imageName"`
    ImageID   *Hash        `json:"imageID,omitempty"`
    Labels    Labels       `json:"labels,omitempty"`
    Size      uint         `json:"size,omitempty"`
}

func (Dependency) MarshalJSON Uses

func (d Dependency) MarshalJSON() ([]byte, error)

func (*Dependency) UnmarshalJSON Uses

func (d *Dependency) UnmarshalJSON(data []byte) error

type Environment Uses

type Environment []EnvironmentVariable

func (Environment) Get Uses

func (e Environment) Get(name string) (value string, ok bool)

Retrieve the value of an environment variable by the given name from Environment, if it exists.

func (Environment) MarshalJSON Uses

func (e Environment) MarshalJSON() ([]byte, error)

func (*Environment) Set Uses

func (e *Environment) Set(name string, value string)

Set sets the value of an environment variable by the given name, overwriting if one already exists.

func (*Environment) UnmarshalJSON Uses

func (e *Environment) UnmarshalJSON(data []byte) error

type EnvironmentVariable Uses

type EnvironmentVariable struct {
    Name  string `json:"name"`
    Value string `json:"value"`
}

type EventHandler Uses

type EventHandler struct {
    Name string `json:"name"`
    Exec Exec   `json:"exec"`
}

func (EventHandler) MarshalJSON Uses

func (e EventHandler) MarshalJSON() ([]byte, error)

func (*EventHandler) UnmarshalJSON Uses

func (e *EventHandler) UnmarshalJSON(data []byte) error

type Exec Uses

type Exec []string

func (Exec) MarshalJSON Uses

func (e Exec) MarshalJSON() ([]byte, error)

func (*Exec) UnmarshalJSON Uses

func (e *Exec) UnmarshalJSON(data []byte) error

type ExposedPort Uses

type ExposedPort struct {
    Name     ACName `json:"name"`
    HostPort uint   `json:"hostPort"`
    HostIP   net.IP `json:"hostIP,omitempty"`  // optional
    PodPort  *Port  `json:"podPort,omitempty"` // optional. If missing, try and find a corresponding App's port
}

ExposedPort represents a port listening on the host side. The PodPort is optional -- if missing, then try and find the pod-side information by matching names

type Hash Uses

type Hash struct {
    Val string
    // contains filtered or unexported fields
}

Hash encodes a hash specified in a string of the form:

"<type>-<value>"

for example

"sha512-06c733b1838136838e6d2d3e8fa5aea4c7905e92[...]"

Valid types are currently:

* sha512

func NewHash Uses

func NewHash(s string) (*Hash, error)

func NewHashSHA512 Uses

func NewHashSHA512(b []byte) *Hash

func (Hash) Empty Uses

func (h Hash) Empty() bool

func (Hash) MarshalJSON Uses

func (h Hash) MarshalJSON() ([]byte, error)

func (*Hash) Set Uses

func (h *Hash) Set(s string) error

func (Hash) String Uses

func (h Hash) String() string

func (*Hash) UnmarshalJSON Uses

func (h *Hash) UnmarshalJSON(data []byte) error

type Isolator Uses

type Isolator struct {
    // Name is the name of the Isolator type as defined in the specification.
    Name ACIdentifier `json:"name"`
    // ValueRaw captures the raw JSON value of an Isolator that was
    // unmarshalled. This field is used for unmarshalling only. It MUST NOT
    // be referenced by external users of the Isolator struct. It is
    // exported only to satisfy Go's unfortunate requirement that fields
    // must be capitalized to be unmarshalled successfully.
    ValueRaw *json.RawMessage `json:"value"`
    // contains filtered or unexported fields
}

Isolator is a model for unmarshalling isolator types from their JSON-encoded representation.

func (*Isolator) UnmarshalJSON Uses

func (i *Isolator) UnmarshalJSON(b []byte) error

UnmarshalJSON populates this Isolator from a JSON-encoded representation. To unmarshal the Value of the Isolator, it will use the appropriate constructor as registered by AddIsolatorValueConstructor.

func (*Isolator) Value Uses

func (i *Isolator) Value() IsolatorValue

Value returns the raw Value of this Isolator. Users should perform a type switch/assertion on this value to extract the underlying isolator type.

type IsolatorValue Uses

type IsolatorValue interface {
    // UnmarshalJSON unserialize a JSON-encoded isolator
    UnmarshalJSON(b []byte) error
    // AssertValid returns a non-nil error value if an IsolatorValue is not valid
    // according to appc spec
    AssertValid() error
    // Conflicts returns a list of conflicting isolators types, which cannot co-exist
    // together with this IsolatorValue
    Conflicts() []ACIdentifier
    // contains filtered or unexported methods
}

IsolatorValue encapsulates the actual value of an Isolator which may be serialized as any arbitrary JSON blob. Specific Isolator types should implement this interface to facilitate unmarshalling and validation.

type IsolatorValueConstructor Uses

type IsolatorValueConstructor func() IsolatorValue

type Isolators Uses

type Isolators []Isolator

Isolators encapsulates a list of individual Isolators for the ImageManifest and PodManifest schemas.

func (*Isolators) GetByName Uses

func (is *Isolators) GetByName(name ACIdentifier) *Isolator

GetByName returns the last isolator in the list by the given name.

func (*Isolators) ReplaceIsolatorsByName Uses

func (is *Isolators) ReplaceIsolatorsByName(newIs Isolator, oldNames []ACIdentifier)

ReplaceIsolatorsByName overrides matching isolator types with a new isolator, deleting them all and appending the new one instead

func (*Isolators) Unrecognized Uses

func (is *Isolators) Unrecognized() Isolators

Unrecognized returns a set of isolators that are not recognized. An isolator is not recognized if it has not had an associated constructor registered with AddIsolatorValueConstructor.

type Label Uses

type Label struct {
    Name  ACIdentifier `json:"name"`
    Value string       `json:"value"`
}

type Labels Uses

type Labels []Label

func LabelsFromMap Uses

func LabelsFromMap(labelsMap map[ACIdentifier]string) (Labels, error)

LabelsFromMap creates Labels from a map[ACIdentifier]string

func (Labels) Get Uses

func (l Labels) Get(name string) (val string, ok bool)

Get retrieves the value of the label by the given name from Labels, if it exists

func (Labels) MarshalJSON Uses

func (l Labels) MarshalJSON() ([]byte, error)

func (Labels) ToMap Uses

func (l Labels) ToMap() map[ACIdentifier]string

ToMap creates a map[ACIdentifier]string.

func (*Labels) UnmarshalJSON Uses

func (l *Labels) UnmarshalJSON(data []byte) error

type LinuxAppArmorProfile Uses

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

func NewLinuxAppArmorProfile Uses

func NewLinuxAppArmorProfile(apparmorProfile string) (*LinuxAppArmorProfile, error)

func (LinuxAppArmorProfile) AsIsolator Uses

func (l LinuxAppArmorProfile) AsIsolator() (*Isolator, error)

func (LinuxAppArmorProfile) AssertValid Uses

func (l LinuxAppArmorProfile) AssertValid() error

func (LinuxAppArmorProfile) Conflicts Uses

func (l LinuxAppArmorProfile) Conflicts() []ACIdentifier

func (LinuxAppArmorProfile) Profile Uses

func (l LinuxAppArmorProfile) Profile() LinuxAppArmorProfileProfile

func (*LinuxAppArmorProfile) UnmarshalJSON Uses

func (l *LinuxAppArmorProfile) UnmarshalJSON(b []byte) error

type LinuxAppArmorProfileProfile Uses

type LinuxAppArmorProfileProfile string

type LinuxCPUShares Uses

type LinuxCPUShares int

LinuxCPUShares assigns the CPU time share weight to the processes executed. See https://www.freedesktop.org/software/systemd/man/systemd.resource-control.html#CPUShares=weight, https://www.kernel.org/doc/Documentation/scheduler/sched-design-CFS.txt

func NewLinuxCPUShares Uses

func NewLinuxCPUShares(val int) (*LinuxCPUShares, error)

func (LinuxCPUShares) AsIsolator Uses

func (l LinuxCPUShares) AsIsolator() Isolator

func (LinuxCPUShares) AssertValid Uses

func (l LinuxCPUShares) AssertValid() error

func (LinuxCPUShares) Conflicts Uses

func (l LinuxCPUShares) Conflicts() []ACIdentifier

func (*LinuxCPUShares) UnmarshalJSON Uses

func (l *LinuxCPUShares) UnmarshalJSON(b []byte) error

type LinuxCapabilitiesRetainSet Uses

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

func NewLinuxCapabilitiesRetainSet Uses

func NewLinuxCapabilitiesRetainSet(caps ...string) (*LinuxCapabilitiesRetainSet, error)

func (LinuxCapabilitiesRetainSet) AsIsolator Uses

func (l LinuxCapabilitiesRetainSet) AsIsolator() (*Isolator, error)

func (LinuxCapabilitiesRetainSet) AssertValid Uses

func (l LinuxCapabilitiesRetainSet) AssertValid() error

func (LinuxCapabilitiesRetainSet) Conflicts Uses

func (l LinuxCapabilitiesRetainSet) Conflicts() []ACIdentifier

func (LinuxCapabilitiesRetainSet) Set Uses

func (l LinuxCapabilitiesRetainSet) Set() []LinuxCapability

func (*LinuxCapabilitiesRetainSet) UnmarshalJSON Uses

func (l *LinuxCapabilitiesRetainSet) UnmarshalJSON(b []byte) error

type LinuxCapabilitiesRevokeSet Uses

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

func NewLinuxCapabilitiesRevokeSet Uses

func NewLinuxCapabilitiesRevokeSet(caps ...string) (*LinuxCapabilitiesRevokeSet, error)

func (LinuxCapabilitiesRevokeSet) AsIsolator Uses

func (l LinuxCapabilitiesRevokeSet) AsIsolator() (*Isolator, error)

func (LinuxCapabilitiesRevokeSet) AssertValid Uses

func (l LinuxCapabilitiesRevokeSet) AssertValid() error

func (LinuxCapabilitiesRevokeSet) Conflicts Uses

func (l LinuxCapabilitiesRevokeSet) Conflicts() []ACIdentifier

func (LinuxCapabilitiesRevokeSet) Set Uses

func (l LinuxCapabilitiesRevokeSet) Set() []LinuxCapability

func (*LinuxCapabilitiesRevokeSet) UnmarshalJSON Uses

func (l *LinuxCapabilitiesRevokeSet) UnmarshalJSON(b []byte) error

type LinuxCapabilitiesSet Uses

type LinuxCapabilitiesSet interface {
    Set() []LinuxCapability
    AssertValid() error
}

type LinuxCapability Uses

type LinuxCapability string

type LinuxNoNewPrivileges Uses

type LinuxNoNewPrivileges bool

func (LinuxNoNewPrivileges) AssertValid Uses

func (l LinuxNoNewPrivileges) AssertValid() error

func (LinuxNoNewPrivileges) Conflicts Uses

func (l LinuxNoNewPrivileges) Conflicts() []ACIdentifier

func (*LinuxNoNewPrivileges) UnmarshalJSON Uses

func (l *LinuxNoNewPrivileges) UnmarshalJSON(b []byte) error

type LinuxOOMScoreAdj Uses

type LinuxOOMScoreAdj int // -1000 to 1000

LinuxOOMScoreAdj is equivalent to /proc/[pid]/oom_score_adj

func NewLinuxOOMScoreAdj Uses

func NewLinuxOOMScoreAdj(val int) (*LinuxOOMScoreAdj, error)

func (LinuxOOMScoreAdj) AsIsolator Uses

func (l LinuxOOMScoreAdj) AsIsolator() Isolator

func (LinuxOOMScoreAdj) AssertValid Uses

func (l LinuxOOMScoreAdj) AssertValid() error

func (LinuxOOMScoreAdj) Conflicts Uses

func (l LinuxOOMScoreAdj) Conflicts() []ACIdentifier

func (*LinuxOOMScoreAdj) UnmarshalJSON Uses

func (l *LinuxOOMScoreAdj) UnmarshalJSON(b []byte) error

type LinuxSELinuxContext Uses

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

func NewLinuxSELinuxContext Uses

func NewLinuxSELinuxContext(selinuxUser, selinuxRole, selinuxType, selinuxLevel string) (*LinuxSELinuxContext, error)

func (LinuxSELinuxContext) AsIsolator Uses

func (l LinuxSELinuxContext) AsIsolator() (*Isolator, error)

func (LinuxSELinuxContext) AssertValid Uses

func (l LinuxSELinuxContext) AssertValid() error

func (LinuxSELinuxContext) Conflicts Uses

func (l LinuxSELinuxContext) Conflicts() []ACIdentifier

func (LinuxSELinuxContext) Level Uses

func (l LinuxSELinuxContext) Level() LinuxSELinuxLevel

func (LinuxSELinuxContext) Role Uses

func (l LinuxSELinuxContext) Role() LinuxSELinuxRole

func (LinuxSELinuxContext) Type Uses

func (l LinuxSELinuxContext) Type() LinuxSELinuxType

func (*LinuxSELinuxContext) UnmarshalJSON Uses

func (l *LinuxSELinuxContext) UnmarshalJSON(b []byte) error

func (LinuxSELinuxContext) User Uses

func (l LinuxSELinuxContext) User() LinuxSELinuxUser

type LinuxSELinuxLevel Uses

type LinuxSELinuxLevel string

type LinuxSELinuxRole Uses

type LinuxSELinuxRole string

type LinuxSELinuxType Uses

type LinuxSELinuxType string

type LinuxSELinuxUser Uses

type LinuxSELinuxUser string

type LinuxSeccompEntry Uses

type LinuxSeccompEntry string

type LinuxSeccompErrno Uses

type LinuxSeccompErrno string

type LinuxSeccompRemoveSet Uses

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

func NewLinuxSeccompRemoveSet Uses

func NewLinuxSeccompRemoveSet(errno string, syscall ...string) (*LinuxSeccompRemoveSet, error)

func (LinuxSeccompRemoveSet) AsIsolator Uses

func (l LinuxSeccompRemoveSet) AsIsolator() (*Isolator, error)

func (LinuxSeccompRemoveSet) AssertValid Uses

func (l LinuxSeccompRemoveSet) AssertValid() error

func (LinuxSeccompRemoveSet) Conflicts Uses

func (l LinuxSeccompRemoveSet) Conflicts() []ACIdentifier

func (LinuxSeccompRemoveSet) Errno Uses

func (l LinuxSeccompRemoveSet) Errno() LinuxSeccompErrno

func (LinuxSeccompRemoveSet) Set Uses

func (l LinuxSeccompRemoveSet) Set() []LinuxSeccompEntry

func (*LinuxSeccompRemoveSet) UnmarshalJSON Uses

func (l *LinuxSeccompRemoveSet) UnmarshalJSON(b []byte) error

type LinuxSeccompRetainSet Uses

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

func NewLinuxSeccompRetainSet Uses

func NewLinuxSeccompRetainSet(errno string, syscall ...string) (*LinuxSeccompRetainSet, error)

func (LinuxSeccompRetainSet) AsIsolator Uses

func (l LinuxSeccompRetainSet) AsIsolator() (*Isolator, error)

func (LinuxSeccompRetainSet) AssertValid Uses

func (l LinuxSeccompRetainSet) AssertValid() error

func (LinuxSeccompRetainSet) Conflicts Uses

func (l LinuxSeccompRetainSet) Conflicts() []ACIdentifier

func (LinuxSeccompRetainSet) Errno Uses

func (l LinuxSeccompRetainSet) Errno() LinuxSeccompErrno

func (LinuxSeccompRetainSet) Set Uses

func (l LinuxSeccompRetainSet) Set() []LinuxSeccompEntry

func (*LinuxSeccompRetainSet) UnmarshalJSON Uses

func (l *LinuxSeccompRetainSet) UnmarshalJSON(b []byte) error

type LinuxSeccompSet Uses

type LinuxSeccompSet interface {
    Set() []LinuxSeccompEntry
    Errno() LinuxSeccompErrno
    AssertValid() error
}

type MountPoint Uses

type MountPoint struct {
    Name     ACName `json:"name"`
    Path     string `json:"path"`
    ReadOnly bool   `json:"readOnly,omitempty"`
}

MountPoint is the application-side manifestation of a Volume.

func MountPointFromString Uses

func MountPointFromString(mp string) (*MountPoint, error)

MountPointFromString takes a command line mountpoint parameter and returns a mountpoint

It is useful for actool patch-manifest --mounts

Example mountpoint parameters:

database,path=/tmp,readOnly=true

type Port Uses

type Port struct {
    Name            ACName `json:"name"`
    Protocol        string `json:"protocol"`
    Port            uint   `json:"port"`
    Count           uint   `json:"count"`
    SocketActivated bool   `json:"socketActivated"`
}

Port represents a port as offered by an application *inside* the pod.

func PortFromString Uses

func PortFromString(pt string) (*Port, error)

PortFromString takes a command line port parameter and returns a port

It is useful for actool patch-manifest --ports

Example port parameters:

     health-check,protocol=udp,port=8000
	query,protocol=tcp,port=8080,count=1,socketActivated=true

func (Port) MarshalJSON Uses

func (p Port) MarshalJSON() ([]byte, error)

func (*Port) UnmarshalJSON Uses

func (p *Port) UnmarshalJSON(data []byte) error

type Resource Uses

type Resource interface {
    Limit() *resource.Quantity
    Request() *resource.Quantity
    Default() bool
}

type ResourceBase Uses

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

func (ResourceBase) AssertValid Uses

func (r ResourceBase) AssertValid() error

func (ResourceBase) Conflicts Uses

func (l ResourceBase) Conflicts() []ACIdentifier

func (ResourceBase) Default Uses

func (r ResourceBase) Default() bool

func (ResourceBase) Limit Uses

func (r ResourceBase) Limit() *resource.Quantity

func (ResourceBase) Request Uses

func (r ResourceBase) Request() *resource.Quantity

func (*ResourceBase) UnmarshalJSON Uses

func (r *ResourceBase) UnmarshalJSON(b []byte) error

type ResourceBlockBandwidth Uses

type ResourceBlockBandwidth struct {
    ResourceBase
}

func (ResourceBlockBandwidth) AssertValid Uses

func (r ResourceBlockBandwidth) AssertValid() error

type ResourceBlockIOPS Uses

type ResourceBlockIOPS struct {
    ResourceBase
}

func (ResourceBlockIOPS) AssertValid Uses

func (r ResourceBlockIOPS) AssertValid() error

type ResourceCPU Uses

type ResourceCPU struct {
    ResourceBase
}

func NewResourceCPUIsolator Uses

func NewResourceCPUIsolator(request, limit string) (*ResourceCPU, error)

func (ResourceCPU) AsIsolator Uses

func (r ResourceCPU) AsIsolator() Isolator

func (ResourceCPU) AssertValid Uses

func (r ResourceCPU) AssertValid() error

func (ResourceCPU) String Uses

func (r ResourceCPU) String() string

type ResourceMemory Uses

type ResourceMemory struct {
    ResourceBase
}

func NewResourceMemoryIsolator Uses

func NewResourceMemoryIsolator(request, limit string) (*ResourceMemory, error)

func (ResourceMemory) AsIsolator Uses

func (r ResourceMemory) AsIsolator() Isolator

func (ResourceMemory) AssertValid Uses

func (r ResourceMemory) AssertValid() error

func (ResourceMemory) String Uses

func (r ResourceMemory) String() string

type ResourceNetworkBandwidth Uses

type ResourceNetworkBandwidth struct {
    ResourceBase
}

func (ResourceNetworkBandwidth) AssertValid Uses

func (r ResourceNetworkBandwidth) AssertValid() error

type SemVer Uses

type SemVer semver.Version

SemVer implements the Unmarshaler interface to define a field that must be a semantic version string TODO(jonboulle): extend upstream instead of wrapping?

func NewSemVer Uses

func NewSemVer(s string) (*SemVer, error)

NewSemVer generates a new SemVer from a string. If the given string does not represent a valid SemVer, nil and an error are returned.

func (SemVer) Empty Uses

func (sv SemVer) Empty() bool

func (SemVer) LessThanExact Uses

func (sv SemVer) LessThanExact(versionB SemVer) bool

func (SemVer) LessThanMajor Uses

func (sv SemVer) LessThanMajor(versionB SemVer) bool

func (SemVer) MarshalJSON Uses

func (sv SemVer) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (SemVer) String Uses

func (sv SemVer) String() string

func (*SemVer) UnmarshalJSON Uses

func (sv *SemVer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface

type URL Uses

type URL url.URL

URL wraps url.URL to marshal/unmarshal to/from JSON strings and enforce that the scheme is HTTP/HTTPS only

func NewURL Uses

func NewURL(s string) (*URL, error)

func (URL) MarshalJSON Uses

func (u URL) MarshalJSON() ([]byte, error)

func (URL) String Uses

func (u URL) String() string

func (*URL) UnmarshalJSON Uses

func (u *URL) UnmarshalJSON(data []byte) error

type UUID Uses

type UUID [16]byte

UUID encodes an RFC4122-compliant UUID, marshaled to/from a string TODO(jonboulle): vendor a package for this? TODO(jonboulle): consider more flexibility in input string formats. Right now, we only accept:

"6733C088-A507-4694-AABF-EDBE4FC5266F"
"6733C088A5074694AABFEDBE4FC5266F"

func NewUUID Uses

func NewUUID(s string) (*UUID, error)

NewUUID generates a new UUID from the given string. If the string does not represent a valid UUID, nil and an error are returned.

func (UUID) Empty Uses

func (u UUID) Empty() bool

func (UUID) MarshalJSON Uses

func (u UUID) MarshalJSON() ([]byte, error)

func (*UUID) Set Uses

func (u *UUID) Set(s string) error

func (UUID) String Uses

func (u UUID) String() string

func (*UUID) UnmarshalJSON Uses

func (u *UUID) UnmarshalJSON(data []byte) error

type UnixSysctl Uses

type UnixSysctl map[string]string

func NewUnixSysctlIsolator Uses

func NewUnixSysctlIsolator(cfg map[string]string) (*UnixSysctl, error)

func (UnixSysctl) AsIsolator Uses

func (s UnixSysctl) AsIsolator() Isolator

func (UnixSysctl) AssertValid Uses

func (s UnixSysctl) AssertValid() error

func (UnixSysctl) Conflicts Uses

func (s UnixSysctl) Conflicts() []ACIdentifier

func (*UnixSysctl) UnmarshalJSON Uses

func (s *UnixSysctl) UnmarshalJSON(b []byte) error

type UserAnnotations Uses

type UserAnnotations map[string]string

UserAnnotations are arbitrary key-value pairs, to be supplied and interpreted by the user

type UserLabels Uses

type UserLabels map[string]string

UserLabels are arbitrary key-value pairs, to be supplied and interpreted by the user

type Volume Uses

type Volume struct {
    Name ACName `json:"name"`
    Kind string `json:"kind"`

    // currently used only by "host"
    // TODO(jonboulle): factor out?
    Source    string `json:"source,omitempty"`
    ReadOnly  *bool  `json:"readOnly,omitempty"`
    Recursive *bool  `json:"recursive,omitempty"`

    // currently used only by "empty"
    Mode *string `json:"mode,omitempty"`
    UID  *int    `json:"uid,omitempty"`
    GID  *int    `json:"gid,omitempty"`
}

Volume encapsulates a volume which should be mounted into the filesystem of all apps in a PodManifest

func VolumeFromParams Uses

func VolumeFromParams(params map[string][]string) (*Volume, error)

func VolumeFromString Uses

func VolumeFromString(vp string) (*Volume, error)

VolumeFromString takes a command line volume parameter and returns a volume

Example volume parameters:

database,kind=host,source=/tmp,readOnly=true,recursive=true

func (Volume) MarshalJSON Uses

func (v Volume) MarshalJSON() ([]byte, error)

func (Volume) String Uses

func (v Volume) String() string

func (*Volume) UnmarshalJSON Uses

func (v *Volume) UnmarshalJSON(data []byte) error

Directories

PathSynopsis
resource

Package types imports 19 packages (graph) and is imported by 708 packages. Updated 2017-12-22. Refresh now. Tools for package owners.