package types
import "github.com/appc/spec/schema/types"
Index ¶
- Variables
- type ACKind
- func (a ACKind) MarshalJSON() ([]byte, error)
- func (a ACKind) String() string
- func (a *ACKind) UnmarshalJSON(data []byte) error
- type ACKindError
- type ACName
- func NewACName(s string) (*ACName, error)
- func (n ACName) Empty() bool
- func (n ACName) Equals(o ACName) bool
- func (n *ACName) MarshalJSON() ([]byte, error)
- func (n ACName) String() string
- func (n *ACName) UnmarshalJSON(data []byte) error
- type ACNameError
- type ACVersionError
- type AMStartedOnError
- type Annotations
- func (a Annotations) MarshalJSON() ([]byte, error)
- func (a *Annotations) UnmarshalJSON(data []byte) error
- type App
- type Date
- func NewDate(s string) (*Date, error)
- func (d Date) MarshalJSON() ([]byte, error)
- func (d Date) String() string
- func (d *Date) UnmarshalJSON(data []byte) error
- type Dependencies
- type Dependency
- func (d Dependency) MarshalJSON() ([]byte, error)
- func (d *Dependency) UnmarshalJSON(data []byte) error
- type EventHandler
- func (e EventHandler) MarshalJSON() ([]byte, error)
- func (e *EventHandler) UnmarshalJSON(data []byte) error
- type Hash
- func NewHash(s string) (*Hash, error)
- func NewHashSHA256(b []byte) *Hash
- func (h Hash) MarshalJSON() ([]byte, error)
- func (h Hash) String() string
- func (h *Hash) UnmarshalJSON(data []byte) error
- type Isolator
- type Label
- type Labels
- type MountPoint
- type Port
- type SemVer
- func NewSemVer(s string) (*SemVer, error)
- func (sv SemVer) Empty() bool
- func (sv SemVer) MarshalJSON() ([]byte, error)
- func (sv SemVer) String() string
- func (sv *SemVer) UnmarshalJSON(data []byte) error
- type URL
- func NewURL(s string) (*URL, error)
- func (u URL) MarshalJSON() ([]byte, error)
- func (u URL) String() string
- func (u *URL) UnmarshalJSON(data []byte) error
- type UUID
- func NewUUID(s string) (*UUID, error)
- func (u UUID) Empty() bool
- func (u UUID) MarshalJSON() ([]byte, error)
- func (u UUID) String() string
- func (u *UUID) UnmarshalJSON(data []byte) error
- type Volume
Variables ¶
var ( ErrNoZeroSemVer = ACVersionError("SemVer cannot be zero") ErrBadSemVer = ACVersionError("SemVer is bad") )
var ( ErrNoACKind = ACKindError("ACKind must be set") )
Types ¶
type ACKind ¶
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 ¶
func (ACKind) String ¶
func (*ACKind) UnmarshalJSON ¶
type ACKindError ¶
type ACKindError string
An ACKindError is returned when the wrong ACKind is set in a manifest
func (ACKindError) Error ¶
func (e ACKindError) Error() string
type ACName ¶
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 characters accepted by the DNS RFC[1] and "/". ACNames are case-insensitive for comparison purposes, but case-preserving.
[1] http://tools.ietf.org/html/rfc1123#page-13
func NewACName ¶
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 ¶
func (ACName) Equals ¶
Equals checks whether a given ACName is equal to this one.
func (*ACName) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface
func (ACName) String ¶
func (*ACName) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface
type ACNameError ¶
type ACNameError string
An ACNameError is returned when a bad value is used for an ACName
func (ACNameError) Error ¶
func (e ACNameError) Error() string
type ACVersionError ¶
type ACVersionError string
An ACVersionError is returned when a bad ACVersion is set in a manifest
func (ACVersionError) Error ¶
func (e ACVersionError) Error() string
type AMStartedOnError ¶
type AMStartedOnError string
An AMStartedOnError is returned when the wrong StartedOn is set in an ImageManifest
func (AMStartedOnError) Error ¶
func (e AMStartedOnError) Error() string
type Annotations ¶
TODO(jonboulle): this is awkward since it's inconsistent with the way we do things elsewhere (i.e. using strict types instead of string types), but it's tricky because Annotations needs to be able to catch arbitrary key-values. Clean this up somehow?
func (Annotations) MarshalJSON ¶
func (a Annotations) MarshalJSON() ([]byte, error)
func (*Annotations) UnmarshalJSON ¶
func (a *Annotations) UnmarshalJSON(data []byte) error
type App ¶
type App struct { Exec []string `json:"exec"` EventHandlers []EventHandler `json:"eventHandlers"` User string `json:"user"` Group string `json:"group"` Environment map[string]string `json:"environment"` MountPoints []MountPoint `json:"mountPoints"` Ports []Port `json:"ports"` Isolators []Isolator `json:"isolators"` }
func (App) MarshalJSON ¶
func (*App) UnmarshalJSON ¶
type Date ¶
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 ¶
func (Date) MarshalJSON ¶
func (Date) String ¶
func (*Date) UnmarshalJSON ¶
type Dependencies ¶
type Dependencies []Dependency
type Dependency ¶
type Dependency struct { Name ACName `json:"name"` Hash Hash `json:"hash"` Labels Labels `json:"labels"` }
func (Dependency) MarshalJSON ¶
func (d Dependency) MarshalJSON() ([]byte, error)
func (*Dependency) UnmarshalJSON ¶
func (d *Dependency) UnmarshalJSON(data []byte) error
type EventHandler ¶
func (EventHandler) MarshalJSON ¶
func (e EventHandler) MarshalJSON() ([]byte, error)
func (*EventHandler) UnmarshalJSON ¶
func (e *EventHandler) UnmarshalJSON(data []byte) error
type Hash ¶
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
"sha256-06c733b1838136838e6d2d3e8fa5aea4c7905e92"
Valid types are currently "sha256"
func NewHash ¶
func NewHashSHA256 ¶
func (Hash) MarshalJSON ¶
func (Hash) String ¶
func (*Hash) UnmarshalJSON ¶
type Isolator ¶
type Label ¶
type Labels ¶
type Labels []Label
TODO(jonboulle): this is awkward since it's inconsistent with the way we do things elsewhere (i.e. using strict types instead of string types), but it's tricky because Labels needs to be able to catch arbitrary key-values. Clean this up somehow?
func (Labels) MarshalJSON ¶
func (*Labels) UnmarshalJSON ¶
type MountPoint ¶
type MountPoint struct { Name ACName `json:"name"` Path string `json:"path"` ReadOnly bool `json:"readOnly"` }
type Port ¶
type Port struct { Name ACName `json:"name"` Protocol string `json:"protocol"` Port uint `json:"port"` SocketActivated bool `json:"socketActivated"` }
type SemVer ¶
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 ¶
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 ¶
func (SemVer) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface
func (SemVer) String ¶
func (*SemVer) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface
type URL ¶
URL wraps url.URL to marshal/unmarshal to/from JSON strings and enforce that the scheme is HTTP/HTTPS only
func NewURL ¶
func (URL) MarshalJSON ¶
func (URL) String ¶
func (*URL) UnmarshalJSON ¶
type UUID ¶
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 ¶
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 ¶
func (UUID) MarshalJSON ¶
func (UUID) String ¶
func (*UUID) UnmarshalJSON ¶
type Volume ¶
type Volume struct { Kind string `json:"kind"` Fulfills []ACName `json:"fulfills"` // currently used only by "host" // TODO(jonboulle): factor out? Source string `json:"source,omitempty"` ReadOnly bool `json:"readOnly,omitempty"` }
Volume encapsulates a volume which should be mounted into the filesystem of all apps in a ContainerRuntimeManifest
func (Volume) MarshalJSON ¶
func (*Volume) UnmarshalJSON ¶
Source Files ¶
ackind.go acname.go annotations.go app.go date.go dependencies.go errors.go event_handler.go hash.go isolator.go labels.go mountpoint.go port.go semver.go url.go uuid.go volume.go
- Version
- v0.1.1
- Published
- Dec 11, 2014
- Platform
- windows/amd64
- Imports
- 10 packages
- Last checked
- 2 minutes ago –
Tools for package owners.