Help us shape the future of Go! Take the 2026 Go Developer Survey

campaign

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Campaign

type Campaign struct {
	ID             string     `json:"id"`
	Name           string     `json:"name"`
	Kind           string     `json:"kind"`
	State          string     `json:"state"`
	Reason         string     `json:"reason"`
	Version        int64      `json:"version"`
	Stage          int        `json:"stage"`
	RequestedBy    string     `json:"requested_by"`
	Spec           Input      `json:"spec"`
	Counts         Counts     `json:"counts"`
	CreatedAt      time.Time  `json:"created_at"`
	UpdatedAt      time.Time  `json:"updated_at"`
	GrantExpiresAt time.Time  `json:"grant_expires_at"`
	ObservingSince *time.Time `json:"observing_since,omitempty"`
}

type Counts

type Counts struct {
	Total     int `json:"total"`
	Excluded  int `json:"excluded"`
	Pending   int `json:"pending"`
	Running   int `json:"running"`
	Succeeded int `json:"succeeded"`
	Failed    int `json:"failed"`
	Unknown   int `json:"unknown"`
}

type Execution

type Execution struct {
	Halt                  bool
	ActionID              string
	State                 string
	Reason                string
	VerifiedWindowSeconds int64
}

type Input

type Input struct {
	Name               string        `json:"name"`
	Kind               string        `json:"kind"`
	Selection          string        `json:"selection"`
	Members            []MemberInput `json:"members"`
	CanaryIDs          []string      `json:"canary_ids"`
	CanarySize         int           `json:"canary_size"`
	BatchSize          int           `json:"batch_size"`
	Concurrency        int           `json:"concurrency"`
	Success            string        `json:"success"`
	ObservationSeconds int64         `json:"observation_seconds"`
	FailureLimit       int           `json:"failure_limit"`
	FailurePercent     int           `json:"failure_percent"`
	Windows            []Window      `json:"windows"`
	NotBefore          *time.Time    `json:"not_before,omitempty"`
}

type Member

type Member struct {
	ObservedAt      time.Time         `json:"-"`
	ID              string            `json:"id"`
	RepositoryID    string            `json:"repository_id"`
	RepositoryName  string            `json:"repository_name"`
	Repositories    []string          `json:"repositories"`
	Group           string            `json:"group"`
	Canary          bool              `json:"canary"`
	Input           MemberInput       `json:"input"`
	Pins            map[string]string `json:"pins"`
	State           string            `json:"state"`
	Reason          string            `json:"reason"`
	Stage           int               `json:"stage"`
	Halt            bool              `json:"halt"`
	ResumeRequested bool              `json:"-"`
	ActionID        string            `json:"action_id,omitempty"`
	SucceededAt     *time.Time        `json:"succeeded_at,omitempty"`
}

type MemberInput

type MemberInput struct {
	RepositoryID string                     `json:"repository_id"`
	Repair       *repair.Input              `json:"repair,omitempty"`
	Environment  string                     `json:"environment,omitempty"`
	Pipeline     *deployment.PreviewRequest `json:"pipeline,omitempty"`
	GitOps       *gitops.PreviewRequest     `json:"gitops,omitempty"`
}

type Preview

type Preview struct {
	ID        string    `json:"id"`
	Hash      string    `json:"hash"`
	Input     Input     `json:"input"`
	Members   []Member  `json:"members"`
	Blockers  []string  `json:"blockers"`
	ExpiresAt time.Time `json:"expires_at"`
}

type Service

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

func New

func New(db *store.Store, identity *auth.Service, policies *policy.Service, jobs *workflow.Service, images map[string]string, executor Executor) *Service

func (*Service) CheckMergeTx

func (s *Service) CheckMergeTx(ctx context.Context, tx pgx.Tx, org, repo string, snapshot forge.MergeEvidence) error

func (*Service) CheckScopeTx

func (s *Service) CheckScopeTx(ctx context.Context, tx pgx.Tx, org, kind, id string) error

func (*Service) ConfigureExecution

func (s *Service) ConfigureExecution(repairs *repair.Service, pipelines *deployment.Service, promotions *gitops.Service, merges *mergecontrol.Service)

func (*Service) Control

func (s *Service) Control(ctx context.Context, session auth.Session, org, id, action, reason, decision string, expected int64, request string) (Campaign, error)

func (*Service) Create

func (s *Service) Create(ctx context.Context, session auth.Session, org, previewID, key, request string) (Campaign, error)

func (*Service) GateAuthorityTx

func (s *Service) GateAuthorityTx(ctx context.Context, tx pgx.Tx, org, gate string) error

func (*Service) Get

func (s *Service) Get(ctx context.Context, session auth.Session, org, id string) (Campaign, error)

func (*Service) List

func (s *Service) List(ctx context.Context, session auth.Session, org, state, cursor string, limit int) (domain.Page[Campaign], error)

func (*Service) Members

func (s *Service) Members(ctx context.Context, session auth.Session, org, id, cursor string, limit int) (domain.Page[Member], error)

func (*Service) Preview

func (s *Service) Preview(ctx context.Context, session auth.Session, org string, in Input) (Preview, error)

func (*Service) Run

func (s *Service) Run(ctx context.Context) error

func (*Service) Step

func (s *Service) Step(ctx context.Context, org string) error

func (*Service) TaskAuthorityTx

func (s *Service) TaskAuthorityTx(ctx context.Context, tx pgx.Tx, t workflow.Task) error

type Window

type Window struct {
	Weekdays    []int `json:"weekdays"`
	StartMinute int   `json:"start_minute"`
	EndMinute   int   `json:"end_minute"`
}

Jump to

Keyboard shortcuts

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