actor

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package actor carries WHO is performing an action across layer boundaries.

The audit log needs to attribute every mutation, but core.Manager sits below the HTTP and bot layers and can't reach a session cookie or a Telegram update. So the actor rides the request context: each entry point (panel session, API key, Telegram bot, subscription page) stamps it once, and the Manager reads it back when it writes its audit row.

This lives in its own leaf package rather than in core so the bots can stamp an actor without importing core — the telegram package deliberately depends on core only through its own narrow Panel interface.

Index

Constants

This section is empty.

Variables

View Source
var System = Actor{Kind: model.ActorSystem}

System is the fallback for anything the panel does on its own initiative — the background poller, a provider webhook. A context with no actor means exactly this.

Functions

func With

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

With stamps the actor onto ctx for the mutating calls made under it.

Types

type Actor

type Actor struct {
	Kind string
	Name string
}

Actor is who is performing an action: a kind (model.Actor*) and a display name.

func APIKey

func APIKey(name string) Actor

func Admin

func Admin(username string) Actor

Admin / APIKey / Telegram / UserSelf name the four external entry points, so callers don't hand-roll the kind strings.

func From

func From(ctx context.Context) Actor

From returns the actor stamped on ctx, or System when none is.

func Telegram

func Telegram(name string) Actor

func UserSelf

func UserSelf(name string) Actor

Jump to

Keyboard shortcuts

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