Documentation ¶
Index ¶
- Constants
- func DefaultDbusDiscoveryFunc() (res []string, err error)
- func GetZeroDiscoveryFunc(paths ...string) func() ([]string, error)
- func IsBlocked(left, right *Pod) (err error)
- func IsEqual(left, right *Pod) (ok bool)
- func ToString(p *Pod) (res string)
- type Asset
- type AssetSlice
- type Blob
- type BlobSlice
- type Header
- type Pod
- type PodSlice
- type Provider
- type ProviderSlice
- type Resource
- func (r *Resource) Clone() (res *Resource)
- func (r *Resource) FromManifest(podName string, req manifest.Resource, env manifest.FlatMap) (err error)
- func (r *Resource) MarshalSpec(w io.Writer) (err error)
- func (r Resource) String() string
- func (r *Resource) UnmarshalSpec(line string, spec Spec, paths SystemPaths) (err error)
- func (r *Resource) ValuesKey() (res string)
- type ResourceSlice
- type Spec
- type SystemPaths
- type Unit
- type UnitFile
- type UnitSlice
Constants ¶
View Source
const DefaultPodPrefix = "pod-*"
View Source
const (
ResourceValuesPostfix = "__values"
)
View Source
const (
SpecRevision = "1.0"
)
Variables ¶
This section is empty.
Functions ¶
func GetZeroDiscoveryFunc ¶
Types ¶
type Asset ¶
type Asset interface { UnmarshalSpec(line string, spec Spec, paths SystemPaths) (err error) MarshalSpec(w io.Writer) (err error) }
Asset entity can recover own state
type AssetSlice ¶
type AssetSlice interface { GetVersionPrefix(version string) (prefix string) GetEmpty(paths SystemPaths) (empty Asset) AppendItem(v Asset) }
Slice of recoverable entities
type Blob ¶
type Blob struct { Name string Permissions int `json:",omitempty"` Leave bool `json:",omitempty"` Source string `json:"-"` }
func (*Blob) UnmarshalSpec ¶
func (b *Blob) UnmarshalSpec(line string, spec Spec, paths SystemPaths) (err error)
Unmarshal blob item from manifest. Line may be in two revisions:
type BlobSlice ¶
type BlobSlice []*Blob
func (*BlobSlice) AppendItem ¶
func (*BlobSlice) GetEmpty ¶
func (s *BlobSlice) GetEmpty(paths SystemPaths) (empty Asset)
func (*BlobSlice) GetVersionPrefix ¶
type Header ¶
func (*Header) UnmarshalSpec ¶
func (h *Header) UnmarshalSpec(src string, spec Spec, paths SystemPaths) (err error)
type Pod ¶
type Pod struct { Header UnitFile Units UnitSlice Blobs BlobSlice Resources ResourceSlice Providers ProviderSlice }
Pod represents pod allocated on agent
func (*Pod) FromFilesystem ¶
func (*Pod) FromManifest ¶
func (*Pod) GetPodUnit ¶
type PodSlice ¶
type PodSlice []*Pod
Allocations state
func (*PodSlice) FromFilesystem ¶
func (s *PodSlice) FromFilesystem(systemPaths SystemPaths, discoveryFunc func() ([]string, error)) (err error)
type Provider ¶
func (*Provider) UnmarshalSpec ¶
func (p *Provider) UnmarshalSpec(line string, spec Spec, paths SystemPaths) (err error)
Restore state from header line
type ProviderSlice ¶
type ProviderSlice []*Provider
Allocation providers
func (*ProviderSlice) AppendItem ¶
func (s *ProviderSlice) AppendItem(v Asset)
func (*ProviderSlice) FromManifest ¶
func (*ProviderSlice) GetEmpty ¶
func (s *ProviderSlice) GetEmpty(paths SystemPaths) (empty Asset)
func (*ProviderSlice) GetVersionPrefix ¶
func (s *ProviderSlice) GetVersionPrefix(v string) (p string)
type Resource ¶
type Resource struct { // Requested resource Request manifest.Resource // Allocated values stored in "resource.pod-name.<provider-name>.<resource-name>.__values" environment Values manifest.FlatMap `json:",omitempty"` }
Allocated resource
func (*Resource) FromManifest ¶
func (r *Resource) FromManifest(podName string, req manifest.Resource, env manifest.FlatMap) (err error)
Unmarshal resource allocation from manifest
func (*Resource) MarshalSpec ¶
Marshal resource line
func (*Resource) UnmarshalSpec ¶
func (r *Resource) UnmarshalSpec(line string, spec Spec, paths SystemPaths) (err error)
type ResourceSlice ¶
type ResourceSlice []*Resource
Allocation resources
func (*ResourceSlice) AppendItem ¶
func (r *ResourceSlice) AppendItem(v Asset)
func (*ResourceSlice) FromManifest ¶
func (*ResourceSlice) GetEmpty ¶
func (s *ResourceSlice) GetEmpty(paths SystemPaths) (empty Asset)
func (*ResourceSlice) GetVersionPrefix ¶
func (s *ResourceSlice) GetVersionPrefix(v string) (p string)
type Spec ¶
type Spec struct {
Revision string
}
func (Spec) UnmarshalAssetSlice ¶
func (s Spec) UnmarshalAssetSlice(paths SystemPaths, v AssetSlice, source string) (err error)
type SystemPaths ¶
func DefaultSystemPaths ¶
func DefaultSystemPaths() SystemPaths
type Unit ¶
type Unit struct { UnitFile manifest.Transition `json:",squash"` }
func (*Unit) UnmarshalSpec ¶
func (u *Unit) UnmarshalSpec(line string, spec Spec, paths SystemPaths) (err error)
UnmarshalSpec parses one line from manifest
type UnitFile ¶
type UnitFile struct { SystemPaths SystemPaths `json:"-"` Path string Source string `json:"-"` }
func NewUnitFile ¶
func NewUnitFile(unitName string, paths SystemPaths, runtime bool) (f UnitFile)
Click to show internal directories.
Click to hide internal directories.