schema

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: Apache-2.0 Imports: 14 Imported by: 41

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DotNotationModifier

func DotNotationModifier(s []byte) ([]byte, error)

DotNotationModifier read a byte sequence in dot notation and returns a byte sequence in yaml e.g. foo.bar=boo

func FromFile

func FromFile(s string, fs vfs.FS, m Modifier) ([]byte, error)

FromFile loads a yip config from a YAML file

func FromUrl

func FromUrl(s string, _ vfs.FS, m Modifier) ([]byte, error)

FromUrl loads a yip config from a url

Types

type Auth

type Auth struct {
	Username   string `yaml:"username,omitempty"`
	Password   string `yaml:"password,omitempty"`
	PrivateKey string `yaml:"private_key,omitempty"`

	Insecure  bool   `yaml:"insecure,omitempty"`
	PublicKey string `yaml:"public_key,omitempty"`
}

type DNS

type DNS struct {
	Nameservers []string `yaml:"nameservers,omitempty"`
	DnsSearch   []string `yaml:"search,omitempty"`
	DnsOptions  []string `yaml:"options,omitempty"`
	Path        string   `yaml:"path,omitempty"`
}

type DataSource

type DataSource struct {
	Providers    []string `yaml:"providers,omitempty"`
	Path         string   `yaml:"path,omitempty"`
	UserdataName string   `yaml:"userdata_name,omitempty"`
}

type Dependency added in v1.0.0

type Dependency struct {
	Name string `yaml:"name,omitempty"`
}

type Device

type Device struct {
	InitDisk bool   `yaml:"init_disk,omitempty"`
	DiskName string `yaml:"disk_name,omitempty"`
	Label    string `yaml:"label,omitempty"`
	Path     string `yaml:"path,omitempty"`
}

type Directory

type Directory struct {
	Path         string
	Permissions  uint32
	Owner, Group int
}

type Download

type Download struct {
	Path         string
	URL          string
	Permissions  uint32
	Owner, Group int
	Timeout      int
	OwnerString  string
}

type Expand

type Expand struct {
	Size uint64 `yaml:"size,omitempty"`
}

type File

type File struct {
	Path         string
	Permissions  uint32
	Owner, Group int
	Content      string
	Encoding     string
	OwnerString  string
}

type Git

type Git struct {
	Auth       Auth   `yaml:"auth,omitempty"`
	URL        string `yaml:"url,omitempty"`
	Path       string `yaml:"path,omitempty"`
	Branch     string `yaml:"branch,omitempty"`
	BranchOnly bool   `yaml:"branch_only,omitempty"`
}

type IfCheckType added in v1.18.0

type IfCheckType string
const IfCheckAll IfCheckType = "all"
const IfCheckAny IfCheckType = "any"
const IfCheckNone IfCheckType = "none"

type Layout

type Layout struct {
	Device *Device     `yaml:"device,omitempty"`
	Expand *Expand     `yaml:"expand_partition,omitempty"`
	Parts  []Partition `yaml:"add_partitions,omitempty"`
}

type Loader

type Loader func(s string, fs vfs.FS, m Modifier) ([]byte, error)

type Modifier

type Modifier func(s []byte) ([]byte, error)

type Packages added in v1.13.0

type Packages struct {
	Install []string `yaml:"install,omitempty"`
	Remove  []string `yaml:"remove,omitempty"`
	Refresh bool     `yaml:"refresh,omitempty"`
	Upgrade bool     `yaml:"upgrade,omitempty"`
}

type Partition

type Partition struct {
	FSLabel    string `yaml:"fsLabel,omitempty"`
	Size       uint64 `yaml:"size,omitempty"`
	PLabel     string `yaml:"pLabel,omitempty"`
	FileSystem string `yaml:"filesystem,omitempty"`
	Bootable   bool   `yaml:"bootable,omitempty"`
}

type Stage

type Stage struct {
	Commands    []string    `yaml:"commands,omitempty"`
	Files       []File      `yaml:"files,omitempty"`
	Downloads   []Download  `yaml:"downloads,omitempty"`
	Directories []Directory `yaml:"directories,omitempty"`
	If          string      `yaml:"if,omitempty"`

	EnsureEntities  []YipEntity         `yaml:"ensure_entities,omitempty"`
	DeleteEntities  []YipEntity         `yaml:"delete_entities,omitempty"`
	Dns             DNS                 `yaml:"dns,omitempty"`
	Hostname        string              `yaml:"hostname,omitempty"`
	Name            string              `yaml:"name,omitempty"`
	Sysctl          map[string]string   `yaml:"sysctl,omitempty"`
	SSHKeys         map[string][]string `yaml:"authorized_keys,omitempty"`
	Node            string              `yaml:"node,omitempty"`
	Users           map[string]User     `yaml:"users,omitempty"`
	Modules         []string            `yaml:"modules,omitempty"`
	Systemctl       Systemctl           `yaml:"systemctl,omitempty"`
	Environment     map[string]string   `yaml:"environment,omitempty"`
	EnvironmentFile string              `yaml:"environment_file,omitempty"`
	Packages        Packages            `yaml:"packages,omitempty"`
	UnpackImages    []UnpackImageConf   `yaml:"unpack_images,omitempty"`

	After []Dependency `yaml:"after,omitempty"`

	DataSources DataSource `yaml:"datasource,omitempty"`
	Layout      Layout     `yaml:"layout,omitempty"`

	SystemdFirstBoot map[string]string `yaml:"systemd_firstboot,omitempty"`

	TimeSyncd map[string]string `yaml:"timesyncd,omitempty"`
	Git       Git               `yaml:"git,omitempty"`

	OnlyIfOs             string                   `yaml:"only_os,omitempty"`
	OnlyIfOsVersion      string                   `yaml:"only_os_version,omitempty"`
	OnlyIfArch           string                   `yaml:"only_arch,omitempty"`
	OnlyIfServiceManager string                   `yaml:"only_service_manager,omitempty"`
	IfFiles              map[IfCheckType][]string `yaml:"if_files,omitempty"`
}

type Systemctl

type Systemctl struct {
	Enable    []string            `yaml:"enable,omitempty"`
	Disable   []string            `yaml:"disable,omitempty"`
	Start     []string            `yaml:"start,omitempty"`
	Mask      []string            `yaml:"mask,omitempty"`
	Overrides []SystemctlOverride `yaml:"overrides,omitempty"`
}

type SystemctlOverride added in v1.13.0

type SystemctlOverride struct {
	Service string `yaml:"service,omitempty"`
	Content string `yaml:"content,omitempty"`
	Name    string `yaml:"name,omitempty"`
}

type UnpackImageConf added in v1.14.0

type UnpackImageConf struct {
	Source   string `yaml:"source,omitempty"`
	Target   string `yaml:"target,omitempty"`
	Platform string `yaml:"platform,omitempty"`
}

type User

type User struct {
	Name              string   `yaml:"name,omitempty"`
	PasswordHash      string   `yaml:"passwd,omitempty"`
	SSHAuthorizedKeys []string `yaml:"ssh_authorized_keys,omitempty"`
	GECOS             string   `yaml:"gecos,omitempty"`
	Homedir           string   `yaml:"homedir,omitempty"`
	NoCreateHome      bool     `yaml:"no_create_home,omitempty"`
	PrimaryGroup      string   `yaml:"primary_group,omitempty"`
	Groups            []string `yaml:"groups,omitempty"`
	NoUserGroup       bool     `yaml:"no_user_group,omitempty"`
	System            bool     `yaml:"system,omitempty"`
	NoLogInit         bool     `yaml:"no_log_init,omitempty"`
	Shell             string   `yaml:"shell,omitempty"`
	LockPasswd        bool     `yaml:"lock_passwd,omitempty"`
	UID               string   `yaml:"uid,omitempty"`
}

func (User) Exists

func (u User) Exists() bool

type YipConfig

type YipConfig struct {
	Source string             `yaml:"-"`
	Name   string             `yaml:"name,omitempty"`
	Stages map[string][]Stage `yaml:"stages,omitempty"`
}

func Load

func Load(s string, fs vfs.FS, l Loader, m Modifier) (*YipConfig, error)

func (*YipConfig) ToString added in v1.14.0

func (y *YipConfig) ToString() string

ToString returns the yaml representation of the YipConfig

type YipEntity

type YipEntity struct {
	Path   string `yaml:"path"`
	Entity string `yaml:"entity"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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