specs

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: GPL-3.0 Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Copyright © 2024 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2024 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2024 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2024 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2024 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2024 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Index

Constants

View Source
const (
	MARKDEVKIT_CONFIGNAME = "mark-devkit"
	MARKDEVKIT_ENV_PREFIX = "MARKDEVKIT"
	MARKDEVKIT_VERSION    = `0.3.0`
)
View Source
const (
	HookOuterPreSourcer = "outer-pre-sourcer"
	HookInnerChroot     = "inner-chroot"
	HookOuterChroot     = "outer-chroot"
	HookOuterPostChroot = "outer-post-chroot"
	HookOuterPreChroot  = "outer-pre-chroot"
)

Variables

This section is empty.

Functions

func GenDefault

func GenDefault(viper *v.Viper)

Types

type Bind

type Bind struct {
	Source string `yaml:"source,omitempty" json:"source,omitempty"`
	Target string `yaml:"target,omitempty" json:"target,omitempty"`
}

type EnvVar

type EnvVar struct {
	Key   string `yaml:"key" json:"key"`
	Value string `yaml:"value" json:"value"`
}

type Hook

type Hook struct {
	File        string   `yaml:"-" json:"-"`
	Name        string   `yaml:"name,omitempty" json:"name,omitempty"`
	Description string   `yaml:"description,omitempty" json:"description,omitempty"`
	Type        HookType `yaml:"type,omitempty" json:"type,omitempty"`
	Commands    []string `yaml:"commands,omitempty" json:"commands,omitempty"`
	Entrypoint  []string `yaml:"entrypoint,omitempty" json:"entrypoint,omitempty"`

	Binds []Bind `yaml:"chroot_binds,omitempty" json:"chroot_binds,omitempty"`
}

func NewHookFromYaml

func NewHookFromYaml(data []byte, file string) (*Hook, error)

func (*Hook) GetBinds

func (h *Hook) GetBinds() []Bind

func (*Hook) GetCommands

func (h *Hook) GetCommands() []string

func (*Hook) GetDescription

func (h *Hook) GetDescription() string

func (*Hook) GetEntrypoint

func (h *Hook) GetEntrypoint() []string

func (*Hook) GetFile

func (h *Hook) GetFile() string

func (*Hook) GetName

func (h *Hook) GetName() string

func (*Hook) GetType

func (h *Hook) GetType() HookType

type HookFile

type HookFile struct {
	File  string `yaml:"-" json:"-"`
	Hooks []Hook `yaml:"hooks,omitempty" json:"hooks,omitempty"`
}

func NewHookFileFromFile

func NewHookFileFromFile(file string, opts map[string]interface{}) (*HookFile, error)

func NewHookFileFromYaml

func NewHookFileFromYaml(data []byte, file string) (*HookFile, error)

func (*HookFile) GetFile

func (h *HookFile) GetFile() string

func (*HookFile) GetHooks

func (h *HookFile) GetHooks() *[]Hook

type HookType

type HookType string

type Job

type Job struct {
	Name   string    `yaml:"name" json:"name"`
	Source JobSource `yaml:"source,omitempty" json:"source,omitempty"`
	Output JobOutput `yaml:"output,omitempty" json:"omitempty,omitempty"`

	Options map[string]interface{} `yaml:"options,omitempty" json:"options,omitempty"`
	Envs    []*EnvVar              `yaml:"environments,omitempty" json:"environments,omitempty"`

	ChrootBinds []Bind `yaml:"chroot_binds,omitempty" json:"chroot_binds,omitempty"`

	WorkspaceDir string   `yaml:"workspacedir,omitempty" json:"workspacedir,omitempty"`
	HooksBasedir string   `yaml:"hooks_basedir,omitempty" json:"hooks_basedir,omitempty"`
	Hooks        []string `yaml:"hooks_files,omitempty" json:"hooks_files,omitempty"`
}

func (*Job) Render

func (j *Job) Render(specfile string) (*JobRendered, error)

type JobOutput

type JobOutput struct {
	Type string `yaml:"type,omitempty" json:"type,omitempty"`
	Name string `yaml:"name,omitempty" json:"name,omitempty"`
	Dir  string `yaml:"dir,omitempty" json:"dir,omitempty"`

	TarformersSpec *tarf_specs.SpecFile `yaml:"tarformers_specs,omitempty" json:"tarformers_specs,omitempty"`
}

type JobRendered

type JobRendered struct {
	*Job
	HookFile []*HookFile `yaml:"hooks,omitempty" json:"hooks,omitempty"`
}

func (*JobRendered) GetBindsMap

func (j *JobRendered) GetBindsMap() map[string]string

func (*JobRendered) GetOptionsEnvsMap

func (j *JobRendered) GetOptionsEnvsMap() map[string]string

func (*JobRendered) GetPostChrootHooks

func (j *JobRendered) GetPostChrootHooks() *[]*Hook

func (*JobRendered) GetPreChrootHooks

func (j *JobRendered) GetPreChrootHooks() *[]*Hook

func (*JobRendered) GetPreSourcesHooks added in v0.3.0

func (j *JobRendered) GetPreSourcesHooks() *[]*Hook

func (*JobRendered) Json

func (j *JobRendered) Json() ([]byte, error)

func (*JobRendered) Yaml

func (j *JobRendered) Yaml() ([]byte, error)

type JobSource

type JobSource struct {
	Type   string `yaml:"type,omitempty" json:"type,omitempty"`
	Uri    string `yaml:"uri,omitempty" json:"uri,omitempty"`
	Path   string `yaml:"path,omitempty" json:"path,omitempty"`
	Target string `yaml:"target,omitempty" json:"target,omitempty"`

	// Anisie specific options
	AniseConfigPath   string   `yaml:"anise_config,omitempty" json:"anise_config,omitempty"`
	AniseRepositories []string `yaml:"anise_repos,omitempty" json:"anise_repos,omitempty"`
	AnisePackages     []string `yaml:"anise_packages,omitempty" json:"anise_packages,omitempty"`
}

type MarkDevkitConfig

type MarkDevkitConfig struct {
	Viper *v.Viper `yaml:"-" json:"-"`

	General MarkDevkitGeneral `mapstructure:"general" json:"general,omitempty" yaml:"general,omitempty"`
	Logging MarkDevkitLogging `mapstructure:"logging" json:"logging,omitempty" yaml:"logging,omitempty"`
}

func NewMarkDevkitConfig

func NewMarkDevkitConfig(viper *v.Viper) *MarkDevkitConfig

func (*MarkDevkitConfig) GetGeneral

func (c *MarkDevkitConfig) GetGeneral() *MarkDevkitGeneral

func (*MarkDevkitConfig) GetLogging

func (c *MarkDevkitConfig) GetLogging() *MarkDevkitLogging

func (*MarkDevkitConfig) Unmarshal

func (c *MarkDevkitConfig) Unmarshal() error

func (*MarkDevkitConfig) Yaml

func (c *MarkDevkitConfig) Yaml() ([]byte, error)

type MarkDevkitGeneral

type MarkDevkitGeneral struct {
	Debug bool `mapstructure:"debug,omitempty" json:"debug,omitempty" yaml:"debug,omitempty"`
}

func (*MarkDevkitGeneral) HasDebug

func (g *MarkDevkitGeneral) HasDebug() bool

type MarkDevkitLogging

type MarkDevkitLogging struct {
	// Path of the logfile
	Path string `mapstructure:"path,omitempty" json:"path,omitempty" yaml:"path,omitempty"`
	// Enable/Disable logging to file
	EnableLogFile bool `mapstructure:"enable_logfile,omitempty" json:"enable_logfile,omitempty" yaml:"enable_logfile,omitempty"`
	// Enable JSON format logging in file
	JsonFormat bool `mapstructure:"json_format,omitempty" json:"json_format,omitempty" yaml:"json_format,omitempty"`

	// Log level
	Level string `mapstructure:"level,omitempty" json:"level,omitempty" yaml:"level,omitempty"`

	// Enable emoji
	EnableEmoji bool `mapstructure:"enable_emoji,omitempty" json:"enable_emoji,omitempty" yaml:"enable_emoji,omitempty"`
	// Enable/Disable color in logging
	Color bool `mapstructure:"color,omitempty" json:"color,omitempty" yaml:"color,omitempty"`
}

type MetroSpec

type MetroSpec struct {
	Version string `yaml:"version,omitempty" json:"version,omitempty"`
	Jobs    []Job  `yaml:"jobs,omitempty" json:"jobs,omitempty"`

	File string `yaml:"-" json:"-"`
}

func NewMetroSpec

func NewMetroSpec() *MetroSpec

func (*MetroSpec) GetJob

func (s *MetroSpec) GetJob(name string) *Job

func (*MetroSpec) LoadYaml

func (s *MetroSpec) LoadYaml(data []byte, file string) error

Jump to

Keyboard shortcuts

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