schema

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: MIT Imports: 6 Imported by: 13

Documentation

Index

Constants

View Source
const BROADCAST_MESSAGE = "*"
View Source
const DEFAULT_STAGE = "default"
View Source
const DEFAULT_WORKER_GROUP = "default"
View Source
const ENV_PREFIX = "env "
View Source
const ERROR_UNAVAILABLE = Error("not available")
View Source
const EVENT_STARTUP_COMPLETE = "startup complete"
View Source
const MESSAGE_SOURCE_API = "*api"
View Source
const MESSAGE_SOURCE_SERVER = "*server"
View Source
const VAR_PREFIX = "var "

Variables

This section is empty.

Functions

func IsMessageFromPlugin

func IsMessageFromPlugin(source string) bool

Types

type Condition

type Condition struct {
	// Text
	Include []string `json:"include" yaml:"include"`
	Exclude []string `json:"exclude" yaml:"exclude"`

	// Env
	IncludeEnv []string `json:"include env" yaml:"include env"`
	ExcludeEnv []string `json:"exclude env" yaml:"exclude env"`

	// Vars
	IncludeVar []string `json:"include var" yaml:"include var"`
	ExcludeVar []string `json:"exclude var" yaml:"exclude var"`

	// Regex
	Match    []string `json:"match" yaml:"match"`
	Mismatch []string `json:"mismatch" yaml:"mismatch"`
}

func (Condition) Check

func (c Condition) Check(key string, facts map[string]Fact, env map[string]Env, vars map[string]Var) (bool, error)

func (Condition) Empty

func (c Condition) Empty() bool

type Env

type Env struct {
	Value    string `json:"value" yaml:"value"`
	Priority uint32 `json:"priority" yaml:"priority"`
	Secret   bool   `json:"secret" yaml:"secret"`
}

type EnvParam

type EnvParam struct {
	Env     string   `json:"env" yaml:"env"`
	Replace []string `json:"replace" yaml:"replace"`
}

type Error

type Error string

func (Error) Error

func (err Error) Error() string

type Fact

type Fact []string

type FullMessage

type FullMessage struct {
	Message
	Source string
}

type LiteralCommand added in v1.2.0

type LiteralCommand []string

type LiteralParam

type LiteralParam string

type LogReader

type LogReader interface {
	io.ReadSeekCloser

	ReadAt(p []byte, offset int64) (n int, err error)
	Size() (int64, bool)
}

type LogReaderProvider

type LogReaderProvider interface {
	Available() bool
	Reader() (LogReader, error)
	io.Closer
}

type Message

type Message struct {
	Target  string            `json:"target"`
	Options map[string]string `json:"options"`
	Data    []byte            `json:"data"`
}

func BroadcastMessage

func BroadcastMessage(options map[string]string, data []byte) Message

type Pipeline

type Pipeline struct {
	PipelineDefinition `yaml:",inline"`

	Env            map[string]Env    `json:"env" yaml:"env"`
	Facts          map[string]Fact   `json:"facts" yaml:"facts"`
	TaskDomains    map[string]string `json:"taskDomains" yaml:"taskDomains"`
	TrustedDomains []string          `json:"trustedDomains" yaml:"trustedDomains"`
	TrustedTasks   []string          `json:"trustedTasks" yaml:"trustedTasks"`

	Setup Setup `json:"setup" yaml:"setup"`
}

type PipelineDefinition

type PipelineDefinition struct {
	Name        string               `json:"name" yaml:"name"`
	Headline    string               `json:"headline" yaml:"headline"`
	Description string               `json:"description" yaml:"description"`
	When        map[string]Condition `json:"when" yaml:"when"`
	Steps       []Step               `json:"steps" yaml:"steps"`
}

type PipelineResult

type PipelineResult struct {
	Success  bool   `json:"success"`
	ExitCode int    `json:"exitCode"`
	Error    string `json:"error"`
}

type PipelineStatus

type PipelineStatus struct {
	Pipeline    Pipeline
	WorkerGroup string
	ActivityID  string

	Status Status
	Logs   LogReaderProvider
	Result PipelineResult
}

func (*PipelineStatus) Finished

func (s *PipelineStatus) Finished() bool

func (*PipelineStatus) Running

func (s *PipelineStatus) Running() bool

type RawCommand added in v1.2.0

type RawCommand any

type RawParam

type RawParam any

type ResolvedRunConfig

type ResolvedRunConfig struct {
	Command   []string
	Input     string
	Directory string
	User      string
	Params    map[string]string
}

type RunConfig

type RunConfig struct {
	Task      string              `json:"task" yaml:"task"`
	Command   RawCommand          `json:"command" yaml:"command"`
	Input     RawParam            `json:"input" yaml:"input"`
	Directory RawParam            `json:"directory" yaml:"directory"`
	User      RawParam            `json:"user" yaml:"user"`
	Params    map[string]RawParam `json:"params" yaml:"params"`
}

func (RunConfig) GetEnv

func (config RunConfig) GetEnv() []string

func (RunConfig) Resolve

func (config RunConfig) Resolve(env map[string]Env, vars map[string]Var) (result ResolvedRunConfig, unresolvedEnv, unresolvedVars []string, err error)

type Setup

type Setup struct {
	RunConfig `yaml:",inline"`
}

type Status

type Status string
const STATUS_ENQUEUED Status = "enqueued"
const STATUS_FAILED Status = "failed"
const STATUS_RUNNING Status = "running"
const STATUS_SUCCESS Status = "success"
const STATUS_TIMEOUT Status = "timeout"
const STATUS_WAITING Status = "waiting"

type Step

type Step struct {
	RunConfig `yaml:",inline"`

	Name          string               `json:"name" yaml:"name"`
	Stage         string               `json:"stage" yaml:"stage"`
	When          map[string]Condition `json:"when" yaml:"when"`
	IgnoreFailure bool                 `json:"ignoreFailure" yaml:"ignoreFailure"`
}

type Trigger

type Trigger map[string]string

type Var

type Var string

type VarParam

type VarParam struct {
	Var     string   `json:"var" yaml:"var"`
	Replace []string `json:"replace" yaml:"replace"`
}

type WorkerAckRequest

type WorkerAckRequest struct {
	Contract string `json:"contract"`
}

type WorkerLogsPositionResponse

type WorkerLogsPositionResponse struct {
	Position int64 `json:"position"`
}

type WorkerQueueResponse

type WorkerQueueResponse struct {
	Contract string   `json:"contract"`
	Activity string   `json:"activity"`
	Pipeline Pipeline `json:"pipeline"`
}

Jump to

Keyboard shortcuts

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