context

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyCwd    = "cwd"
	KeyStatus = "status"
)
View Source
const (
	StatusSuccess  = "success"
	StatusMessage  = "message"
	StatusMatrixId = "matrixId"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Processes []*RunningStage
	DataMutex sync.Mutex
	Logger    *log.Entry
	Key       string
	Value     string

	Graph    *depgraph.Graph
	IsMatrix bool
	BuildID  uuid.UUID

	TempDir string
	Data    Data
	// contains filtered or unexported fields
}

func (*Context) AddChild

func (c *Context) AddChild(k string, v string) *Context

func (*Context) AddProcess

func (c *Context) AddProcess(stage *RunningStage)

func (*Context) Getenv

func (c *Context) Getenv(k string) string

func (*Context) GetenvWithDefault

func (c *Context) GetenvWithDefault(k string, defaultValue string) string

func (*Context) Parent

func (c *Context) Parent() *Context

func (*Context) RootParent

func (c *Context) RootParent() *Context

func (*Context) SetStatus

func (c *Context) SetStatus(s Status)

type Data

type Data map[string]interface{}

func (Data) AsMap

func (d Data) AsMap() map[string]interface{}

func (Data) GetBool

func (d Data) GetBool(key string) bool

func (Data) GetBoolWithOk

func (d Data) GetBoolWithOk(key string) (bool, bool)

func (Data) GetList

func (d Data) GetList(key string) []string

func (Data) GetMap

func (d Data) GetMap(key string) Data

func (Data) GetString

func (d Data) GetString(key string) string

func (Data) GetStringWithDefault

func (d Data) GetStringWithDefault(key string, defaultValue string) string

type RunningStage

type RunningStage struct {
	Id      string
	Process *exec.Cmd
}

RunningStage schema will be used to store references to running stages and can be used to terminate running stages later

type Status

type Status struct {
	Success  bool
	Message  string
	MatrixId string
}

Jump to

Keyboard shortcuts

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