trigger

package
v0.5.24 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const IncludeSourceable tfeapi.IncludeName = "sourceable"

Variables

This section is empty.

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 TFEAPI

type TFEAPI struct {
	*tfeapi.Responder
	Client     tfeClient
	Authorizer *authz.Authorizer
}

func NewTFEAPI

func NewTFEAPI(
	client tfeClient,
	authorizer *authz.Authorizer,
	responder *tfeapi.Responder,
) *TFEAPI

func (*TFEAPI) AddHandlers

func (a *TFEAPI) AddHandlers(r *mux.Router)

type TFERunTrigger

type TFERunTrigger struct {
	ID         resource.TfeID          `jsonapi:"primary,run-triggers"`
	CreatedAt  time.Time               `jsonapi:"attribute" json:"created-at"`
	Workspace  *workspace.TFEWorkspace `jsonapi:"relationship" json:"workspace"`
	Sourceable *workspace.TFEWorkspace `jsonapi:"relationship" json:"sourceable"`
}

TFERunTrigger represents a run trigger in the TFE API.

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