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

package schema

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

Package schema provides definitions for the JSON schema of the different manifests in the App Container Specification. The manifests are canonically represented in their respective structs:

- `ImageManifest`
- `PodManifest`

Validation is performed through serialization: if a blob of JSON data will unmarshal to one of the *Manifests, it is considered a valid implementation of the standard. Similarly, if a constructed *Manifest struct marshals successfully to JSON, it must be valid.

Index

Package Files

doc.go image.go kind.go pod.go version.go

Constants

const (
    ACIExtension      = ".aci"
    ImageManifestKind = types.ACKind("ImageManifest")
)
const PodManifestKind = types.ACKind("PodManifest")

Variables

var (
    // AppContainerVersion is the SemVer representation of version
    AppContainerVersion types.SemVer
)

type AppList Uses

type AppList []RuntimeApp

func (AppList) Get Uses

func (al AppList) Get(name types.ACName) *RuntimeApp

Get retrieves an app by the specified name from the AppList; if there is no such app, nil is returned. The returned *RuntimeApp MUST be considered read-only.

func (AppList) MarshalJSON Uses

func (al AppList) MarshalJSON() ([]byte, error)

func (*AppList) UnmarshalJSON Uses

func (al *AppList) UnmarshalJSON(data []byte) error

type ImageManifest Uses

type ImageManifest struct {
    ACKind        types.ACKind       `json:"acKind"`
    ACVersion     types.SemVer       `json:"acVersion"`
    Name          types.ACIdentifier `json:"name"`
    Labels        types.Labels       `json:"labels,omitempty"`
    App           *types.App         `json:"app,omitempty"`
    Annotations   types.Annotations  `json:"annotations,omitempty"`
    Dependencies  types.Dependencies `json:"dependencies,omitempty"`
    PathWhitelist []string           `json:"pathWhitelist,omitempty"`
}

func BlankImageManifest Uses

func BlankImageManifest() *ImageManifest

func (*ImageManifest) GetAnnotation Uses

func (im *ImageManifest) GetAnnotation(name string) (val string, ok bool)

func (*ImageManifest) GetLabel Uses

func (im *ImageManifest) GetLabel(name string) (val string, ok bool)

func (ImageManifest) MarshalJSON Uses

func (im ImageManifest) MarshalJSON() ([]byte, error)

func (*ImageManifest) UnmarshalJSON Uses

func (im *ImageManifest) UnmarshalJSON(data []byte) error

type Kind Uses

type Kind struct {
    ACVersion types.SemVer `json:"acVersion"`
    ACKind    types.ACKind `json:"acKind"`
}

func (Kind) MarshalJSON Uses

func (k Kind) MarshalJSON() ([]byte, error)

func (*Kind) UnmarshalJSON Uses

func (k *Kind) UnmarshalJSON(data []byte) error

type Mount Uses

type Mount struct {
    Volume    types.ACName  `json:"volume"`
    Path      string        `json:"path"`
    AppVolume *types.Volume `json:"appVolume,omitempty"`
}

Mount describes the mapping between a volume and the path it is mounted inside of an app's filesystem. The AppVolume is optional. If missing, the pod-level Volume of the same name shall be used.

type PodManifest Uses

type PodManifest struct {
    ACVersion       types.SemVer          `json:"acVersion"`
    ACKind          types.ACKind          `json:"acKind"`
    Apps            AppList               `json:"apps"`
    Volumes         []types.Volume        `json:"volumes"`
    Isolators       []types.Isolator      `json:"isolators"`
    Annotations     types.Annotations     `json:"annotations"`
    Ports           []types.ExposedPort   `json:"ports"`
    UserAnnotations types.UserAnnotations `json:"userAnnotations,omitempty"`
    UserLabels      types.UserLabels      `json:"userLabels,omitempty"`
}

func BlankPodManifest Uses

func BlankPodManifest() *PodManifest

func (PodManifest) MarshalJSON Uses

func (pm PodManifest) MarshalJSON() ([]byte, error)

func (*PodManifest) UnmarshalJSON Uses

func (pm *PodManifest) UnmarshalJSON(data []byte) error

type RuntimeApp Uses

type RuntimeApp struct {
    Name           types.ACName      `json:"name"`
    Image          RuntimeImage      `json:"image"`
    App            *types.App        `json:"app,omitempty"`
    ReadOnlyRootFS bool              `json:"readOnlyRootFS,omitempty"`
    Mounts         []Mount           `json:"mounts,omitempty"`
    Annotations    types.Annotations `json:"annotations,omitempty"`
}

RuntimeApp describes an application referenced in a PodManifest

type RuntimeImage Uses

type RuntimeImage struct {
    Name   *types.ACIdentifier `json:"name,omitempty"`
    ID     types.Hash          `json:"id"`
    Labels types.Labels        `json:"labels,omitempty"`
}

RuntimeImage describes an image referenced in a RuntimeApp

Directories

PathSynopsis
common
lastditchPackage lastditch provides fallback redefinitions of parts of schemas provided by schema package.
typesPackage types contains structs representing the various types in the app container specification.
types/resource

Package schema imports 6 packages (graph) and is imported by 597 packages. Updated 2018-01-29. Refresh now. Tools for package owners.