config

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigPath = "make-rules.yaml"
)

Variables

View Source
var (
	DefaultPlatforms = []string{fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH)}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// Version is the project version, defaults to "1" (backwards compatibility)
	Version string `json:"version,omitempty"`

	// Go config
	Go Go `json:"go,omitempty"`

	// container config
	Container Container `json:"container,omitempty"`
}

Config is the unmarshalled representation of the configuration file

func Load

func Load() (*Config, error)

func LoadOrDie

func LoadOrDie() *Config

func New

func New() *Config

func (*Config) SetDefaults

func (c *Config) SetDefaults()

type Container

type Container struct {
	Registries  []string `json:"registries,omitempty"`
	ImagePrefix string   `json:"imagePrefix,omitempty"`
	ImageSuffix string   `json:"imageSuffix,omitempty"`
}

type Go

type Go struct {
	MinimumVersion string   `json:"minimumVersion,omitempty"`
	Build          GoBuild  `json:"build,omitempty"`
	Mod            GoMod    `json:"mod,omitempty"`
	Format         GoFormat `json:"format,omitempty"`
	Test           GoTest   `json:"test,omitempty"`
}

type GoBuild

type GoBuild struct {
	Platforms      []string `json:"platforms,omitempty"`
	OnBuildImage   string   `json:"onBuildImage,omitempty"`
	GlobalHooksDir string   `json:"globalHooksDir,omitempty"`
	Flags          []string `json:"flags,omitempty"`
	LDFlags        []string `json:"ldflags,omitempty"`
	GCFlags        []string `json:"gcflags,omitempty"`
}

type GoFormat

type GoFormat struct {
	Local   string          `json:"local,omitempty"`
	Exclude GoFormatExclude `json:"exclude,omitempty"`
}

type GoFormatExclude

type GoFormatExclude struct {
	Dirs  []string `json:"dirs,omitempty"`
	Files []string `json:"files,omitempty"`
}

type GoMod

type GoMod struct {
	Require []GoModRequire `json:"require,omitempty"`
	Replace []GoModReplace `json:"replace,omitempty"`
}

type GoModReplace

type GoModReplace struct {
	OldPath string `json:"path,omitempty"`
	NewPath string `json:"newPath,omitempty"`
	Version string `json:"version,omitempty"`
}

type GoModRequire

type GoModRequire struct {
	Path    string `json:"path,omitempty"`
	Version string `json:"version,omitempty"`
}

type GoTest

type GoTest struct {
	Exclude []string `json:"exceptions,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳