actor

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package actor names who or what caused something steps records: a person, or the automatic thing that stood in for one. It is a stdlib-only leaf so the request that learns the person and the page that shows them can share one vocabulary without either importing the other.

The serialized form ("kind:id") is what the state database stores, so the store stays a string column and never learns this type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func With

func With(ctx context.Context, a Actor) context.Context

With carries the actor a request was made by into everything it calls.

Types

type Actor

type Actor struct {
	Kind string
	ID   string
}

Actor is a kind and an id within it. The zero value is "nobody recorded", which every reader treats as absent rather than as a name.

func Backlog

func Backlog() Actor

Backlog is a job queueing itself again for versions a build left waiting.

func Check

func Check(resource string) Actor

Check is a new version of a resource starting work.

func From

func From(ctx context.Context) Actor

From is the actor ctx carries, zero when none was set.

func Local

func Local(name string) Actor

Local is a person who signed in with one of the daemon's own accounts.

func OS

func OS(user string) Actor

OS is a person named only by the environment of a command run on the daemon's machine. Nothing verified it, and every rendering says so.

func Parse

func Parse(stored string) Actor

Parse reads the stored form back. A value with no colon is a name written before actors existed (approvals recorded "web"), kept as an id with no kind rather than guessed at.

func Upstream

func Upstream() Actor

Upstream is a passed: constraint clearing once upstream jobs went green.

func Webhook

func Webhook(resource string) Actor

Webhook is a delivery to a webhook resource starting work.

func (Actor) Automatic

func (a Actor) Automatic() bool

Automatic reports an actor that is not a person: a check, a delivery, a passed: constraint or a backlog.

func (Actor) IsLocal added in v0.3.0

func (a Actor) IsLocal() bool

IsLocal reports a person who signed in with one of the daemon's own accounts.

func (Actor) IsZero

func (a Actor) IsZero() bool

IsZero reports an actor nobody recorded.

func (Actor) Label

func (a Actor) Label() string

Label is how a reader sees the actor: a person by name and where the name came from, anything else as what it is.

func (Actor) String

func (a Actor) String() string

String is the stored form. A kind with no id still keeps its colon, so Parse cannot mistake it for a legacy bare name.

func (Actor) Unverified

func (a Actor) Unverified() bool

Unverified reports an actor whose name nobody checked.

Jump to

Keyboard shortcuts

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