reduce

package
v0.0.0-...-9f54f22 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CleanOptKey       = "clean"
	DeploymentsOptKey = "deployments"
	ProfileOptKey     = "profile"
	RootOptKey        = "root"
	AurClientOptKey   = "aur-client"
)

Options

Functions

func AurClientOpt

func AurClientOpt(val aur.Interface) *opt.Opt

AurClientOpt passes the client to use

func CleanOpt

func CleanOpt(val bool) *opt.Opt

CleanOpt wraps the option to clean the builds

func DefaultAurClientOpt

func DefaultAurClientOpt(opts []*opt.Opt, val aur.Interface) aur.Interface

DefaultAurClientOpt sets the default client if it doesn't exist

func DeploymentsOpt

func DeploymentsOpt(val []string) *opt.Opt

DeploymentsOpt wraps the deployments to build

func GetAurClientOpt

func GetAurClientOpt(opts []*opt.Opt) aur.Interface

GetAurClientOpt returns the client option

func GetCleanOpt

func GetCleanOpt(opts []*opt.Opt) bool

GetCleanOpt return the option to clean the build

func GetDeploymentsOpt

func GetDeploymentsOpt(opts []*opt.Opt) []string

GetDeploymentsOpt return the deployments to build

func GetProfileOpt

func GetProfileOpt(opts []*opt.Opt) string

GetProfileOpt return the profile

func GetRootOpt

func GetRootOpt(opts []*opt.Opt) string

GetRootOpt return the root

func ProfileOpt

func ProfileOpt(val string) *opt.Opt

ProfileOpt passes the profile string

func RootOpt

func RootOpt(val string) *opt.Opt

RootOpt passes the root string

Types

type Distro

type Distro struct {
	Name      string // Distro name
	Release   string // target release
	Arch      string // target architecture e.g. x86_64
	Kernel    string // target kernel string e.g.
	KernelVer string // target kernel version e.g. 5.3.1
}

Distro provides information about the distro being built

type Fake

type Fake struct {
	Reduce
	Data   map[string]interface{} // test data input
	Result map[string]interface{} // test data output
}

Fake instance

func (*Fake) Build

func (fake *Fake) Build(targets []string, opts ...*opt.Opt) (err error)

Build reduce targets

func (*Fake) Clean

func (fake *Fake) Clean(targets []string, opts ...*opt.Opt) error

Clean reduce targets

type Interface

type Interface interface {
	Info() (Distro, error)                          // Info gets the target distro info
	Clean(targets []string, opts ...*opt.Opt) error // Clean reduce targets; opts: ProfileOpt
	Build(targets []string, opts ...*opt.Opt) error // Build reduce targets; opts: ProfileOpt, CleanOpt, DeploymentsOpt
}

Interface is the public interface for reduce

func New

func New(opts ...*opt.Opt) (ins Interface, err error)

New reduce client supports opt.StdProps, Root and AurClient

func NewFake

func NewFake(opts ...*opt.Opt) (ins Interface, err error)

NewFake initializes the new instance with the given options

type Reduce

type Reduce struct {
	opt.StdProps
	// contains filtered or unexported fields
}

Reduce instance

func (*Reduce) Build

func (reduce *Reduce) Build(targets []string, opts ...*opt.Opt) (err error)

Build reduce targets

func (*Reduce) Clean

func (reduce *Reduce) Clean(targets []string, opts ...*opt.Opt) (err error)

Clean reduce targets

func (*Reduce) Info

func (reduce *Reduce) Info() (distro Distro, err error)

Info about the target distro

Jump to

Keyboard shortcuts

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