action

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package action defines the server's link action catalog and URL format. Registration and live target policy remain the tool provider's responsibility.

Index

Constants

View Source
const Unsigned = "link"

Unsigned is the source of a link this server did not issue, or whose signature no longer verifies. Its claimed source is not shown as fact.

Variables

This section is empty.

Functions

func HostOptionsURL

func HostOptionsURL(base, kind, name string) (string, error)

HostOptionsURL links to live choices for a host unit or container. It is navigation only; every action behind it still needs its own approval.

func OptionsURL

func OptionsURL(base, cluster, namespace, pod, workload string) (string, error)

OptionsURL builds a secret-free navigation link, never an approval grant.

func ParseQuery

func ParseQuery(name string, q url.Values) (map[string]any, string, error)

ParseQuery consumes source separately; it can never become a tool argument.

func SetKey added in v0.8.0

func SetKey(key []byte)

SetKey makes URL sign the links it builds and Parse distrust the source of any link without a valid signature. Call it once before serving. Without a key (stdio and tests) sources are taken as written.

func Source

func Source(value, fallback string) (string, error)

func URL

func URL(base, name string, args map[string]any, source string) (string, error)

URL is the sole builder for new action links. Empty base supports local routes.

func Validate

func Validate(name string, args map[string]any) error

Validate rejects all fields outside the catalog, wrong scalar types and values that redaction would mask. Provider Plan validates live targets.

Types

type Choice

type Choice struct {
	Tool             string `json:"tool"`
	Label            string `json:"label"`
	LabelKO          string `json:"label_ko"`
	URL              string `json:"url"`
	Reason           string `json:"reason"`
	ReasonKO         string `json:"reason_ko"`
	Source           string `json:"source"`
	Container        string `json:"container,omitempty"`
	CurrentImage     string `json:"current_image,omitempty"`
	Image            string `json:"image,omitempty"`
	SourceReplicaSet string `json:"source_replicaset,omitempty"`
}

Choice retains the image restoration fields for existing tool consumers.

type Entry

type Entry struct {
	Tool            string
	Arguments       []string
	English, Korean string
	Reversible      bool
}

func Lookup

func Lookup(name string) (Entry, bool)

func Parse

func Parse(u *url.URL) (Entry, map[string]any, string, error)

Parse accepts the generic route and both historical aliases, with the same strict query rules. A query may never override an alias's path arguments.

func (Entry) Label

func (e Entry) Label(language string) string

type Options

type Options struct {
	Actions []Choice `json:"actions"`
	Hint    string   `json:"hint,omitempty"`
	PodGone bool     `json:"pod_gone,omitempty"`
}

Jump to

Keyboard shortcuts

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