appid

package
v1.76.5 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package appid is what the three sorts of GitHub App share: one id space.

A GitHub App is one kind of record in storage layout v5 (ADR 0072), keyed by its id, with a purpose: the App that links a person's GitHub account (id `link`), a catalogue App an operator declares (its own id), or the App a self-hosted runner tier registers with in one organisation (id `runner-<tier>-<org>`). The purpose is also what makes the ids disjoint, so the rules that keep them apart are here and nowhere else.

Index

Constants

View Source
const LinkID = "link"

LinkID is the id of the link App, of which there is at most one.

View Source
const (
	MaxLabels = 16
)

Limits on the labels of an App.

View Source
const RunnerPrefix = "runner-"

RunnerPrefix begins the id of every runner App.

Variables

View Source
var ErrReserved = errors.New("appid: the id is reserved")

ErrReserved is a catalogue App named like an App of another purpose.

Functions

func CheckCatalogueID

func CheckCatalogueID(id string) error

CheckCatalogueID refuses an id a catalogue App may not have: the link App's, and any that begins with the runner Apps' prefix.

func CheckLabels

func CheckLabels(labels map[string]string) error

CheckLabels refuses labels that are too many, or whose key or value is not a short lower-case name. A label has a key and may have an empty value.

func RunnerID

func RunnerID(tier, org string) string

RunnerID is the id of the runner App of a tier in an organisation: `runner-<tier>-<org>`.

func Valid

func Valid(id string) bool

Valid reports whether id can be the id of an App of any purpose, and so name one in an organisation's record.

Types

type Purpose

type Purpose string

Purpose is what an App is for.

const (
	Link      Purpose = "link"
	Catalogue Purpose = "catalogue"
	Runner    Purpose = "runner"
)

The purposes of an App.

func PurposeOf

func PurposeOf(id string) Purpose

PurposeOf is the purpose an id implies: `link` is the link App's, an id that begins `runner-` is a runner App's and any other is a catalogue App's.

func Purposes

func Purposes() []Purpose

Purposes lists every purpose, in the order above.

func (Purpose) Valid

func (p Purpose) Valid() bool

Valid reports whether p is one of Purposes.

Jump to

Keyboard shortcuts

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