config

package
v0.57.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MergeBootLine = func(o *Options) error {
	o.MergeBootCMDLine = true
	return nil
}

Functions

func AddHeader

func AddHeader(header, data string) string

func FromString

func FromString(s string, o interface{}) error

func HasHeader

func HasHeader(userdata, head string) (bool, string)

func MergeYAML

func MergeYAML(objs ...interface{}) ([]byte, error)

func SaveCloudConfig

func SaveCloudConfig(name Stage, yc yip.YipConfig) error

Types

type Bundle

type Bundle struct {
	Repository string `yaml:"repository,omitempty"`
	Rootfs     string `yaml:"rootfs_path,omitempty"`
	DB         string `yaml:"db_path,omitempty"`

	Targets []string `yaml:"targets,omitempty"`
}

type Bundles

type Bundles []Bundle

func (Bundles) Options

func (b Bundles) Options() (res [][]bundles.BundleOption)

type Config

type Config struct {
	Install *Install `yaml:"install,omitempty"`

	ConfigURL          string            `yaml:"config_url,omitempty"`
	Options            map[string]string `yaml:"options,omitempty"`
	IgnoreBundleErrors bool              `yaml:"ignore_bundles_errors,omitempty"`
	Bundles            Bundles           `yaml:"bundles,omitempty"`
	// contains filtered or unexported fields
}

func Scan

func Scan(opts ...Option) (c *Config, err error)

func (Config) Data

func (c Config) Data() map[string]interface{}

func (Config) IsValid

func (c Config) IsValid() bool

func (Config) Location

func (c Config) Location() string

func (Config) String

func (c Config) String() string

func (Config) Unmarshal

func (c Config) Unmarshal(o interface{}) error

type Install

type Install struct {
	Auto     bool   `yaml:"auto,omitempty"`
	Reboot   bool   `yaml:"reboot,omitempty"`
	Device   string `yaml:"device,omitempty"`
	Poweroff bool   `yaml:"poweroff,omitempty"`
}

type Option

type Option func(o *Options) error

func Directories

func Directories(d ...string) Option

func WithBootCMDLineFile

func WithBootCMDLineFile(s string) Option

type Options

type Options struct {
	ScanDir          []string
	BootCMDLineFile  string
	MergeBootCMDLine bool
}

func (*Options) Apply

func (o *Options) Apply(opts ...Option) error

type Stage

type Stage string
const (
	NetworkStage Stage = "network"
)

func (Stage) String

func (n Stage) String() string

Jump to

Keyboard shortcuts

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