config

package
v0.0.0-...-dbf5b56 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2018 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Sha512  int = 128
	Sha384  int = 96
	Sha256  int = 64
	Sha224  int = 56
	Sha1    int = 40
	Md5     int = 32
	Empty   int = 0
	Invalid int = -1
)
View Source
const (
	Command string = "command"
	OpenRC  string = "openrc"
)

Variables

This section is empty.

Functions

func GetHashType

func GetHashType(hash string) int

Types

type Binary

type Binary struct {
	Downloadable `yaml:",inline"`
	Name         string      `yaml:"name"`
	Format       string      `yaml:"format"`
	Mode         os.FileMode `yaml:"mode"`
}

func (*Binary) GetBinaryPath

func (b *Binary) GetBinaryPath() string

func (*Binary) GetDownloadPath

func (b *Binary) GetDownloadPath() string

func (Binary) Validate

func (b Binary) Validate() error

type Config

type Config struct {
	Extends  []Extend  `yaml:"extends"`
	Packages []Package `yaml:"packages"`
}

func New

func New(configYaml []byte) (config Config, err error)

func (Config) Validate

func (c Config) Validate() error

type Downloadable

type Downloadable struct {
	Src     string `yaml:"src"`
	SrcHash string `yaml:"src_hash"`
}

type Extend

type Extend struct {
	Downloadable `yaml:",inline"`
}

func (*Extend) GetDownloadPath

func (e *Extend) GetDownloadPath() string

func (Extend) Validate

func (e Extend) Validate() error

type File

type File struct {
	Path    string      `yaml:"path"`
	Content string      `yaml:"content"`
	Mode    os.FileMode `yaml:"mode"`
}

func (File) Validate

func (f File) Validate() error

type Init

type Init struct {
	Type    string `yaml:"type"`
	Content string `yaml:"content"`
}

func (Init) Validate

func (i Init) Validate() error

type Package

type Package struct {
	Name     string    `yaml:"name"`
	Binaries []Binary  `yaml:"binaries"`
	Files    []File    `yaml:"files"`
	Services []Service `yaml:"services"`
	Inits    []Init    `yaml:"inits"`
}

func (Package) Validate

func (p Package) Validate() error

type Service

type Service struct {
	Binary string   `yaml:"binary"`
	Args   []string `yaml:"args"`
}

func (Service) Validate

func (s Service) Validate() error

Jump to

Keyboard shortcuts

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