types

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFilesystemInvalidFormat = errors.New("invalid filesystem format")
	ErrFilesystemNoMountPath   = errors.New("filesystem is missing mount or path")
	ErrFilesystemMountAndPath  = errors.New("filesystem has both mount and path defined")
)
View Source
var (
	ErrHashMalformed    = errors.New("malformed hash specifier")
	ErrHashWrongSize    = errors.New("incorrect size for hash sum")
	ErrHashUnrecognized = errors.New("unrecognized hash function")
)
View Source
var (
	ErrOldVersion = errors.New("incorrect config version (too old)")
	ErrNewVersion = errors.New("incorrect config version (too new)")
)
View Source
var (
	ErrCompressionInvalid = errors.New("invalid compression method")
)
View Source
var (
	ErrFileIllegalMode = errors.New("illegal file mode")
)
View Source
var (
	ErrPathRelative = errors.New("path not absolute")
)
View Source
var (
	MaxVersion = semver.Version{
		Major: 2,
		Minor: 0,
	}
)

Functions

This section is empty.

Types

type Compression

type Compression string

func (Compression) AssertValid added in v0.7.0

func (c Compression) AssertValid() error

func (*Compression) UnmarshalJSON

func (c *Compression) UnmarshalJSON(data []byte) error

type Config

type Config struct {
	Ignition Ignition `json:"ignition"`
	Storage  Storage  `json:"storage,omitempty"`
	Systemd  Systemd  `json:"systemd,omitempty"`
	Networkd Networkd `json:"networkd,omitempty"`
	Passwd   Passwd   `json:"passwd,omitempty"`
}

func (Config) AssertValid added in v0.7.0

func (c Config) AssertValid() error

type ConfigReference

type ConfigReference struct {
	Source       Url          `json:"source,omitempty"`
	Verification Verification `json:"verification,omitempty"`
}

type Disk

type Disk struct {
	Device     Path        `json:"device,omitempty"`
	WipeTable  bool        `json:"wipeTable,omitempty"`
	Partitions []Partition `json:"partitions,omitempty"`
}

func (Disk) AssertValid added in v0.7.0

func (n Disk) AssertValid() error

func (*Disk) UnmarshalJSON

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

type File

type File struct {
	Filesystem string       `json:"filesystem,omitempty"`
	Path       Path         `json:"path,omitempty"`
	Contents   FileContents `json:"contents,omitempty"`
	Mode       FileMode     `json:"mode,omitempty"`
	User       FileUser     `json:"user,omitempty"`
	Group      FileGroup    `json:"group,omitempty"`
}

type FileContents

type FileContents struct {
	Compression  Compression  `json:"compression,omitempty"`
	Source       Url          `json:"source,omitempty"`
	Verification Verification `json:"verification,omitempty"`
}

type FileGroup

type FileGroup struct {
	Id int `json:"id,omitempty"`
}

type FileMode

type FileMode os.FileMode

func (FileMode) AssertValid added in v0.7.0

func (m FileMode) AssertValid() error

func (*FileMode) UnmarshalJSON

func (m *FileMode) UnmarshalJSON(data []byte) error

type FileUser

type FileUser struct {
	Id int `json:"id,omitempty"`
}

type Filesystem

type Filesystem struct {
	Name  string           `json:"name,omitempty"`
	Mount *FilesystemMount `json:"mount,omitempty"`
	Path  Path             `json:"path,omitempty"`
}

func (Filesystem) AssertValid added in v0.7.0

func (f Filesystem) AssertValid() error

func (*Filesystem) UnmarshalJSON

func (f *Filesystem) UnmarshalJSON(data []byte) error

type FilesystemCreate

type FilesystemCreate struct {
	Force   bool        `json:"force,omitempty"`
	Options MkfsOptions `json:"options,omitempty"`
}

type FilesystemFormat

type FilesystemFormat string

func (FilesystemFormat) AssertValid added in v0.7.0

func (f FilesystemFormat) AssertValid() error

func (*FilesystemFormat) UnmarshalJSON

func (f *FilesystemFormat) UnmarshalJSON(data []byte) error

type FilesystemMount

type FilesystemMount struct {
	Device Path              `json:"device,omitempty"`
	Format FilesystemFormat  `json:"format,omitempty"`
	Create *FilesystemCreate `json:"create,omitempty"`
}

func (FilesystemMount) AssertValid added in v0.7.0

func (f FilesystemMount) AssertValid() error

func (*FilesystemMount) UnmarshalJSON

func (f *FilesystemMount) UnmarshalJSON(data []byte) error

type Group

type Group struct {
	Name         string `json:"name,omitempty"`
	Gid          *uint  `json:"gid,omitempty"`
	PasswordHash string `json:"passwordHash,omitempty"`
	System       bool   `json:"system,omitempty"`
}

type Hash

type Hash struct {
	Function string
	Sum      string
}

func (Hash) AssertValid added in v0.7.0

func (h Hash) AssertValid() error

func (Hash) MarshalJSON

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

func (*Hash) UnmarshalJSON

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

type Ignition

type Ignition struct {
	Version IgnitionVersion `json:"version,omitempty" merge:"old"`
	Config  IgnitionConfig  `json:"config,omitempty"  merge:"new"`
}

type IgnitionConfig

type IgnitionConfig struct {
	Append  []ConfigReference `json:"append,omitempty"`
	Replace *ConfigReference  `json:"replace,omitempty"`
}

type IgnitionVersion

type IgnitionVersion semver.Version

func (IgnitionVersion) AssertValid

func (v IgnitionVersion) AssertValid() error

func (IgnitionVersion) MarshalJSON

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

func (*IgnitionVersion) UnmarshalJSON

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

type MkfsOptions

type MkfsOptions []string

func (MkfsOptions) AssertValid added in v0.7.0

func (o MkfsOptions) AssertValid() error

func (*MkfsOptions) UnmarshalJSON

func (o *MkfsOptions) UnmarshalJSON(data []byte) error

type Networkd

type Networkd struct {
	Units []NetworkdUnit `json:"units,omitempty"`
}

type NetworkdUnit

type NetworkdUnit struct {
	Name     NetworkdUnitName `json:"name,omitempty"`
	Contents string           `json:"contents,omitempty"`
}

type NetworkdUnitName

type NetworkdUnitName string

func (NetworkdUnitName) AssertValid added in v0.7.0

func (n NetworkdUnitName) AssertValid() error

func (*NetworkdUnitName) UnmarshalJSON

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

type Partition

type Partition struct {
	Label    PartitionLabel     `json:"label,omitempty"`
	Number   int                `json:"number"`
	Size     PartitionDimension `json:"size"`
	Start    PartitionDimension `json:"start"`
	TypeGUID PartitionTypeGUID  `json:"typeGuid,omitempty"`
}

type PartitionDimension

type PartitionDimension uint64

func (*PartitionDimension) UnmarshalJSON

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

type PartitionLabel

type PartitionLabel string

func (PartitionLabel) AssertValid added in v0.7.0

func (n PartitionLabel) AssertValid() error

func (*PartitionLabel) UnmarshalJSON

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

type PartitionTypeGUID

type PartitionTypeGUID string

func (PartitionTypeGUID) AssertValid added in v0.7.0

func (d PartitionTypeGUID) AssertValid() error

func (*PartitionTypeGUID) UnmarshalJSON

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

type Passwd

type Passwd struct {
	Users  []User  `json:"users,omitempty"`
	Groups []Group `json:"groups,omitempty"`
}

type Path

type Path string

func (Path) AssertValid added in v0.7.0

func (p Path) AssertValid() error

func (Path) MarshalJSON

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

func (*Path) UnmarshalJSON

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

type Raid

type Raid struct {
	Name    string `json:"name"`
	Level   string `json:"level"`
	Devices []Path `json:"devices,omitempty"`
	Spares  int    `json:"spares,omitempty"`
}

func (Raid) AssertValid added in v0.7.0

func (n Raid) AssertValid() error

func (*Raid) UnmarshalJSON

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

type Storage

type Storage struct {
	Disks       []Disk       `json:"disks,omitempty"`
	Arrays      []Raid       `json:"raid,omitempty"`
	Filesystems []Filesystem `json:"filesystems,omitempty"`
	Files       []File       `json:"files,omitempty"`
}

type Systemd

type Systemd struct {
	Units []SystemdUnit `json:"units,omitempty"`
}

type SystemdUnit

type SystemdUnit struct {
	Name     SystemdUnitName     `json:"name,omitempty"`
	Enable   bool                `json:"enable,omitempty"`
	Mask     bool                `json:"mask,omitempty"`
	Contents string              `json:"contents,omitempty"`
	DropIns  []SystemdUnitDropIn `json:"dropins,omitempty"`
}

type SystemdUnitDropIn

type SystemdUnitDropIn struct {
	Name     SystemdUnitDropInName `json:"name,omitempty"`
	Contents string                `json:"contents,omitempty"`
}

type SystemdUnitDropInName

type SystemdUnitDropInName string

func (SystemdUnitDropInName) AssertValid added in v0.7.0

func (n SystemdUnitDropInName) AssertValid() error

func (*SystemdUnitDropInName) UnmarshalJSON

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

type SystemdUnitName

type SystemdUnitName string

func (SystemdUnitName) AssertValid added in v0.7.0

func (n SystemdUnitName) AssertValid() error

func (*SystemdUnitName) UnmarshalJSON

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

type Url

type Url url.URL

func (Url) MarshalJSON

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

func (Url) String

func (u Url) String() string

func (*Url) UnmarshalJSON

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

type User

type User struct {
	Name              string      `json:"name,omitempty"`
	PasswordHash      string      `json:"passwordHash,omitempty"`
	SSHAuthorizedKeys []string    `json:"sshAuthorizedKeys,omitempty"`
	Create            *UserCreate `json:"create,omitempty"`
}

type UserCreate

type UserCreate struct {
	Uid          *uint    `json:"uid,omitempty"`
	GECOS        string   `json:"gecos,omitempty"`
	Homedir      string   `json:"homeDir,omitempty"`
	NoCreateHome bool     `json:"noCreateHome,omitempty"`
	PrimaryGroup string   `json:"primaryGroup,omitempty"`
	Groups       []string `json:"groups,omitempty"`
	NoUserGroup  bool     `json:"noUserGroup,omitempty"`
	System       bool     `json:"system,omitempty"`
	NoLogInit    bool     `json:"noLogInit,omitempty"`
	Shell        string   `json:"shell,omitempty"`
}

type Verification

type Verification struct {
	Hash *Hash `json:"hash,omitempty"`
}

Jump to

Keyboard shortcuts

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