model

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: Apache-2.0 Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromMap

func FromMap[S, T any](m map[string]S) (T, error)

FromNMap converts m to T. See https://pkg.go.dev/github.com/mitchellh/mapstructure#section-readme

Types

type BuildInfo

type BuildInfo struct {
	Project string `toml:"project"`
	Tag     string `toml:"tag"`
	Goos    string `toml:"goos"`
	Goarch  string `toml:"goarch"`
}

BuildInfo hold the core information about a build. This is used both by the plugins and the built-in archive implementation as the template context for the name template. It's kept here in this package because it's convenient.

type Error

type Error struct {
	Msg string `toml:"msg"`
}

Error holds an error message.

func NewError

func NewError(what string, err error) *Error

Error is an error that can be returned from a plugin, it's main quality is that it can be marshalled to and from TOML/JSON etc.

func (Error) Error

func (r Error) Error() string

type Initializer

type Initializer interface {
	// Init initializes a config struct, that could be parsing of strings into Go objects, compiling of Glob patterns etc.
	// It returns an error if the initialization failed.
	Init() error
}

Jump to

Keyboard shortcuts

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