trigger

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTriggerLoop = errors.New("workspace cannot trigger itself")

Functions

This section is empty.

Types

type Direction

type Direction string
const (
	// Inbound filters triggers by the workspace that triggers the queried
	// workspace.
	Inbound Direction = "inbound"
	// Outbound filters triggers by workspaces that are triggered *by* the
	// queried workspace.
	Outbound Direction = "outbound"
)

type ListOptions

type ListOptions struct {
	// WorkspaceID is the workspace whose triggers are being listed.
	WorkspaceID resource.TfeID `schema:"workspace_id"`
	// Filters by direction: "inbound" (triggering workspaces that trigger this
	// workspace) or "outbound" (workspaces this workspace triggers).
	Direction Direction `schema:"filter[run-trigger][type]"`
}

ListOptions filters run triggers by workspace and direction.

type Options

type Options struct {
	DB         *sql.DB
	Logger     logr.Logger
	Authorizer *authz.Authorizer
}

type RunTriggerService

type RunTriggerService = Service

Alias service to permit embedding it with other services in a struct without a name clash.

type Service

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

func NewService

func NewService(opts Options) *Service

func (*Service) CreateRunTrigger

func (s *Service) CreateRunTrigger(ctx context.Context, workspaceID, triggeringWorkspaceID resource.TfeID) (*Trigger, error)

func (*Service) DeleteRunTrigger

func (s *Service) DeleteRunTrigger(ctx context.Context, triggerID resource.TfeID) error

func (*Service) GetRunTrigger

func (s *Service) GetRunTrigger(ctx context.Context, triggerID resource.TfeID) (*Trigger, error)

func (*Service) ListRunTriggers

func (s *Service) ListRunTriggers(ctx context.Context, opts ListOptions) ([]*Trigger, error)

type Trigger

type Trigger struct {
	ID                    resource.TfeID `db:"run_trigger_id"`
	CreatedAt             time.Time      `db:"created_at"`
	WorkspaceID           resource.TfeID `db:"workspace_id"`
	TriggeringWorkspaceID resource.TfeID `db:"triggering_workspace_id"`
}

func (*Trigger) LogValue

func (t *Trigger) LogValue() slog.Value

LogValue implements slog.LogValuer.

type Triggerer

type Triggerer struct {
	Client client
	Logger logr.Logger
}

Triggerer creates runs when runs on a sourceable workspace complete.

func (*Triggerer) Start

func (t *Triggerer) Start(ctx context.Context) error

Directories

Path Synopsis
templ: version: v0.3.1001
templ: version: v0.3.1001

Jump to

Keyboard shortcuts

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