schema

package
v0.0.0-...-d19b8bf Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

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, fs 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"`
}

type Dependency

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

type Device

type Device struct {
	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 uint `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 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 Partition

type Partition struct {
	FSLabel    string `yaml:"fsLabel,omitempty"`
	Size       uint   `yaml:"size,omitempty"`
	PLabel     string `yaml:"pLabel,omitempty"`
	FileSystem string `yaml:"filesystem,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"`

	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"`
}

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"`
}

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 {
	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)

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