spec

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2019 License: ISC Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SpecFile is the default name of specification/configuration file
	SpecFile = "cherry.yaml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Build

type Build struct {
	CrossCompile   bool     `json:"crossCompile" yaml:"cross_compile"`
	MainFile       string   `json:"mainFile" yaml:"main_file"`
	BinaryFile     string   `json:"binaryFile" yaml:"binary_file"`
	VersionPackage string   `json:"versionPackage" yaml:"version_package"`
	GoVersions     []string `json:"goVersions" yaml:"go_versions"`
	Platforms      []string `json:"platforms" yaml:"platforms"`
}

Build represents a build artifact

func (*Build) FlagSet

func (b *Build) FlagSet() *flag.FlagSet

FlagSet returns a flag set for parsing input arguments

func (*Build) SetDefaults

func (b *Build) SetDefaults()

SetDefaults set default values for empty fields

type Release

type Release struct {
	Build bool `json:"build" yaml:"build"`
}

Release specifies the configurations for release command

func (*Release) FlagSet

func (r *Release) FlagSet() *flag.FlagSet

FlagSet returns a flag set for parsing input arguments

func (*Release) SetDefaults

func (r *Release) SetDefaults()

SetDefaults set default values for empty fields

type Spec

type Spec struct {
	ToolName    string `json:"-" yaml:"-"`
	ToolVersion string `json:"-" yaml:"-"`

	Version     string  `json:"version" yaml:"version"`
	Language    string  `json:"language" yaml:"language"`
	VersionFile string  `json:"versionFile" yaml:"version_file"`
	Test        Test    `json:"test" yaml:"test"`
	Build       Build   `json:"build" yaml:"build"`
	Release     Release `json:"release" yaml:"release"`
}

Spec is Cherry specs

func Read

func Read(path string) (*Spec, error)

Read reads and returns a Spec from a YAML file

func (*Spec) SetDefaults

func (s *Spec) SetDefaults()

SetDefaults set default values for empty fields

type Test

type Test struct {
	ReportPath string `json:"reportPath" yaml:"report_path"`
}

Test specifies the configurations for test command

func (*Test) FlagSet

func (t *Test) FlagSet() *flag.FlagSet

FlagSet returns a flag set for parsing input arguments

func (*Test) SetDefaults

func (t *Test) SetDefaults()

SetDefaults set default values for empty fields

Jump to

Keyboard shortcuts

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