context

package
v0.136.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2020 License: MIT Imports: 6 Imported by: 20

Documentation

Overview

Package context provides gorelease context which is passed through the pipeline.

The context extends the standard library context and add a few more fields and other things, so pipes can gather data provided by previous pipes without really knowing each other.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	ctx.Context
	Config             config.Project
	Env                Env
	SkipTokenCheck     bool
	Token              string
	TokenType          TokenType
	Git                GitInfo
	Artifacts          artifact.Artifacts
	ReleaseNotes       string
	ReleaseHeader      string
	ReleaseFooter      string
	Version            string
	Snapshot           bool
	SkipPostBuildHooks bool
	SkipPublish        bool
	SkipSign           bool
	SkipValidate       bool
	RmDist             bool
	PreRelease         bool
	Deprecated         bool
	Parallelism        int
	Semver             Semver
}

Context carries along some data through the pipes

func New

func New(config config.Project) *Context

New context

func NewWithTimeout

func NewWithTimeout(config config.Project, timeout time.Duration) (*Context, ctx.CancelFunc)

NewWithTimeout new context with the given timeout

func Wrap

func Wrap(ctx ctx.Context, config config.Project) *Context

Wrap wraps an existing context

type Env added in v0.104.2

type Env map[string]string

Env is the environment variables

func (Env) Copy added in v0.125.0

func (e Env) Copy() Env

Copy returns a copy of the environment.

func (Env) Strings added in v0.104.2

func (e Env) Strings() []string

Strings returns the current environment as a list of strings, suitable for os executions.

type GitInfo

type GitInfo struct {
	CurrentTag  string
	Commit      string
	ShortCommit string
	FullCommit  string
	URL         string
}

GitInfo includes tags and diffs used in some point

type Semver added in v0.98.0

type Semver struct {
	Major      uint64
	Minor      uint64
	Patch      uint64
	Prerelease string
}

Semver represents a semantic version

type TokenType added in v0.116.0

type TokenType string

TokenType is either github or gitlab

const (
	// TokenTypeGitHub defines github as type of the token
	TokenTypeGitHub TokenType = "github"
	// TokenTypeGitLab defines gitlab as type of the token
	TokenTypeGitLab TokenType = "gitlab"
	// TokenTypeGitea defines gitea as type of the token
	TokenTypeGitea TokenType = "gitea"
)

Jump to

Keyboard shortcuts

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