domain

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifacts

type Artifacts struct {
	Paths     []string `yaml:"paths,omitempty"`
	ExpireIn  string   `yaml:"expire_in,omitempty"`
	Reports   *Reports `yaml:"reports,omitempty"`
	Name      string   `yaml:"name,omitempty"`
	Untracked bool     `yaml:"untracked,omitempty"`
	When      string   `yaml:"when,omitempty"`
	ExposeAs  string   `yaml:"expose_as,omitempty"`
}

Artifacts represents job artifacts.

type Cache

type Cache struct {
	Key    string   `yaml:"key"`
	Paths  []string `yaml:"paths"`
	Policy string   `yaml:"policy,omitempty"`
}

Cache represents GitLab CI cache configuration.

type DefaultConfig

type DefaultConfig struct {
	Image *ImageConfig `yaml:"image,omitempty"`
}

DefaultConfig represents default job configuration.

type IDToken

type IDToken struct {
	Aud string `yaml:"aud"`
}

IDToken represents GitLab CI OIDC token configuration.

type ImageConfig

type ImageConfig struct {
	Name       string   `yaml:"name,omitempty"`
	Entrypoint []string `yaml:"entrypoint,omitempty"`
}

ImageConfig represents GitLab CI image configuration.

func (ImageConfig) MarshalYAML

func (img ImageConfig) MarshalYAML() (any, error)

MarshalYAML emits the short string form when entrypoint is empty.

type Job

type Job struct {
	// contains filtered or unexported fields
}

Job represents a GitLab CI job.

func NewJob added in v0.10.6

func NewJob(opts JobOptions) (Job, error)

func (Job) AfterScript

func (j Job) AfterScript() []string

func (Job) AllowFailure

func (j Job) AllowFailure() bool

func (Job) Artifacts

func (j Job) Artifacts() *Artifacts

func (Job) BeforeScript

func (j Job) BeforeScript() []string

func (Job) Cache

func (j Job) Cache() *Cache

func (Job) HasNeed added in v0.10.6

func (j Job) HasNeed(name string) bool

func (Job) IDTokens

func (j Job) IDTokens() map[string]*IDToken

func (Job) Image

func (j Job) Image() *ImageConfig

func (Job) MarshalYAML added in v0.10.6

func (j Job) MarshalYAML() (any, error)

func (Job) Needs

func (j Job) Needs() []JobNeed

func (Job) ResourceGroup

func (j Job) ResourceGroup() string

func (Job) Rules

func (j Job) Rules() []Rule

func (Job) Script

func (j Job) Script() []string

func (Job) Secrets

func (j Job) Secrets() map[string]*Secret

func (Job) Stage

func (j Job) Stage() string

func (Job) Tags

func (j Job) Tags() []string

func (Job) Variables

func (j Job) Variables() map[string]string

func (Job) When

func (j Job) When() string

type JobNeed

type JobNeed struct {
	Job       string `yaml:"job"`
	Optional  bool   `yaml:"optional,omitempty"`
	Artifacts *bool  `yaml:"artifacts,omitempty"`
}

JobNeed represents a job dependency.

type JobOptions added in v0.10.6

type JobOptions struct {
	Stage         string
	Image         *ImageConfig
	Script        []string
	BeforeScript  []string
	AfterScript   []string
	Variables     map[string]string
	Needs         []JobNeed
	Rules         []Rule
	Artifacts     *Artifacts
	Cache         *Cache
	Secrets       map[string]*Secret
	IDTokens      map[string]*IDToken
	When          string
	AllowFailure  bool
	Tags          []string
	ResourceGroup string
}

type Pipeline

type Pipeline struct {
	// contains filtered or unexported fields
}

Pipeline represents a GitLab CI pipeline.

func EmptyPipeline added in v0.10.6

func EmptyPipeline() *Pipeline

func (*Pipeline) Default

func (p *Pipeline) Default() *DefaultConfig

func (*Pipeline) HasNeed added in v0.10.6

func (p *Pipeline) HasNeed(jobName, dependency string) bool

func (*Pipeline) Job added in v0.10.6

func (p *Pipeline) Job(name string) (Job, bool)

func (*Pipeline) JobCount added in v0.10.6

func (p *Pipeline) JobCount() int

func (*Pipeline) JobNames added in v0.10.6

func (p *Pipeline) JobNames() []string

func (*Pipeline) Stages

func (p *Pipeline) Stages() []string

func (*Pipeline) ToYAML

func (p *Pipeline) ToYAML() ([]byte, error)

ToYAML converts the pipeline to YAML.

func (*Pipeline) Variables

func (p *Pipeline) Variables() map[string]string

func (*Pipeline) Workflow

func (p *Pipeline) Workflow() *Workflow

type PipelineBuilder added in v0.10.6

type PipelineBuilder struct {
	// contains filtered or unexported fields
}

func NewPipelineBuilder added in v0.10.6

func NewPipelineBuilder(opts PipelineOptions) *PipelineBuilder

func (*PipelineBuilder) AddJob added in v0.10.6

func (b *PipelineBuilder) AddJob(name string, job Job) error

func (*PipelineBuilder) Build added in v0.10.6

func (b *PipelineBuilder) Build() (*Pipeline, error)

type PipelineOptions added in v0.10.6

type PipelineOptions struct {
	Stages    []string
	Variables map[string]string
	Default   *DefaultConfig
	Workflow  *Workflow
}

type Reports

type Reports struct {
	Terraform []string `yaml:"terraform,omitempty"`
	JUnit     []string `yaml:"junit,omitempty"`
	Cobertura []string `yaml:"cobertura,omitempty"`
}

Reports represents artifact reports.

type Rule

type Rule struct {
	If      string   `yaml:"if,omitempty"`
	When    string   `yaml:"when,omitempty"`
	Changes []string `yaml:"changes,omitempty"`
}

Rule represents a job or workflow rule.

type Secret

type Secret struct {
	Vault     *VaultSecret `yaml:"vault,omitempty"`
	VaultPath string       `yaml:"-"`
	File      bool         `yaml:"file,omitempty"`
}

Secret represents GitLab CI secret configuration.

func (Secret) MarshalYAML

func (s Secret) MarshalYAML() (any, error)

MarshalYAML emits the short vault syntax when configured.

type VaultEngine

type VaultEngine struct {
	Name string `yaml:"name"`
	Path string `yaml:"path"`
}

VaultEngine represents Vault secrets engine configuration.

type VaultSecret

type VaultSecret struct {
	Engine *VaultEngine `yaml:"engine,omitempty"`
	Path   string       `yaml:"path,omitempty"`
	Field  string       `yaml:"field,omitempty"`
}

VaultSecret represents a secret from HashiCorp Vault.

type Workflow

type Workflow struct {
	// contains filtered or unexported fields
}

Workflow controls when pipelines are created.

func NewWorkflowRules added in v0.10.6

func NewWorkflowRules(rules []Rule) *Workflow

func (*Workflow) MarshalYAML added in v0.10.6

func (w *Workflow) MarshalYAML() (any, error)

func (*Workflow) Rules

func (w *Workflow) Rules() []Rule

Jump to

Keyboard shortcuts

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