Documentation
¶
Index ¶
Constants ¶
View Source
const ( TypeCopy = "copy" TypeInclude = "include" TypeLink = "link" TypeMerge = "merge" TypeMkdir = "mkdir" TypeMove = "move" TypeNetwork = "network" TypeRemove = "remove" TypeReplace = "replace" TypeShell = "shell" TypeSystemd = "systemd" )
Variables ¶
View Source
var EtcHostname = "/etc/hostname"
View Source
var EtcHosts = "/etc/hosts"
Functions ¶
func GetEnvFromOutput ¶
Types ¶
type CopyBody ¶
type CopyBody struct {
// Путь до файла, кого копировать
Source string `yaml:"source,omitempty" json:"source,omitempty" required:""`
// Путь до файла, куда копировать
Destination string `yaml:"destination,omitempty" json:"destination,omitempty" required:""`
// Заменять ли destination
Replace bool `yaml:"replace,omitempty" json:"replace,omitempty"`
}
type IncludeBody ¶
type IncludeBody struct {
// yml конфиги для выполнения
Targets []string `yaml:"targets,omitempty" json:"targets,omitempty" required:""`
}
func (*IncludeBody) Execute ¶
func (b *IncludeBody) Execute(ctx context.Context, svc build.RuntimeContext) (any, error)
func (*IncludeBody) IncludeTargets ¶
func (b *IncludeBody) IncludeTargets() []string
IncludeTargets сообщает цели include движку для рекурсивной валидации.
type LinkBody ¶
type LinkBody struct {
// Где создать ссылку, абсолютный путь
Target string `yaml:"target,omitempty" json:"target,omitempty" required:""`
// Куда она будет вести
To string `yaml:"to,omitempty" json:"to,omitempty" required:""`
// Заменить ли target
Replace bool `yaml:"replace,omitempty" json:"replace,omitempty"`
}
type MergeBody ¶
type MergeBody struct {
// Путь до файла, содержимое которого нужно взять
Source string `yaml:"source,omitempty" json:"source,omitempty" required:""`
// Путь до файла, куда нужно добавить содержимое
Destination string `yaml:"destination,omitempty" json:"destination,omitempty" required:""`
// Права для создания файла в формате rwxrwxrwx, если он не существует
CreateFilePerm string `yaml:"create-file-perm,omitempty" json:"create-file-perm,omitempty"`
// Добавлять ли содержимое в начало файла
Prepend bool `yaml:"prepend,omitempty" json:"prepend,omitempty"`
}
type MkdirBody ¶
type MoveBody ¶
type MoveBody struct {
// Что
Source string `yaml:"source,omitempty" json:"source,omitempty" required:""`
// Куда
Destination string `yaml:"destination,omitempty" json:"destination,omitempty" required:""`
// Заменить объект по destination
Replace bool `yaml:"replace,omitempty" json:"replace,omitempty"`
// Создать ссылку из родительской директории цели на назначение
CreateLink bool `yaml:"create-link,omitempty" json:"create-link,omitempty"`
}
type NetworkBody ¶
type NetworkBody struct {
// Hostname in image
Hostname string `yaml:"hostname,omitempty" json:"hostname,omitempty" required:""`
}
func (*NetworkBody) Execute ¶
func (b *NetworkBody) Execute(_ context.Context, _ build.RuntimeContext) (any, error)
type RemoveBody ¶
type RemoveBody struct {
// Путь до объектов, которые нужно удалить
Targets []string `yaml:"targets,omitempty" json:"targets,omitempty" required:""`
// Очистить объекты вместо удаления
Inside bool `yaml:"inside,omitempty" json:"inside,omitempty"`
}
func (*RemoveBody) Execute ¶
func (b *RemoveBody) Execute(_ context.Context, _ build.RuntimeContext) (any, error)
type ReplaceBody ¶
type ReplaceBody struct {
// Путь до файла
Target string `yaml:"target,omitempty" json:"target,omitempty" required:""`
// Regex шаблон
Pattern string `yaml:"pattern,omitempty" json:"pattern,omitempty" required:""`
// Замена
Repl string `yaml:"repl,omitempty" json:"repl,omitempty" required:""`
}
func (*ReplaceBody) Execute ¶
func (b *ReplaceBody) Execute(_ context.Context, _ build.RuntimeContext) (any, error)
type ShellBody ¶
type ShellOutput ¶
type SystemdBody ¶
type SystemdBody struct {
// Имена сервисов
Targets []string `yaml:"targets,omitempty" json:"targets,omitempty" required:""`
// Включать или нет
Enabled bool `yaml:"enabled,omitempty" json:"enabled,omitempty" conflicts:"Masked"`
// Включать ли сервис глобально, для всех пользователей
Global bool `yaml:"global,omitempty" json:"global,omitempty"`
// Маскировать ли сервис
Masked bool `yaml:"masked,omitempty" json:"masked,omitempty" conflicts:"Enabled"`
}
func (*SystemdBody) Execute ¶
func (b *SystemdBody) Execute(ctx context.Context, svc build.RuntimeContext) (any, error)
Click to show internal directories.
Click to hide internal directories.