internal

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package internal provides internal types and functions for the bootstrap addon.

Most of these are here to avoid dependency cycles, and will have aliases for most of their functionality exposed in the main bootstrap package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear added in v0.5.0

func Clear[T any](ctx *Context, k InfoKey[T])

func Get

func Get[T any](ctx *Context, k InfoKey[T]) (T, bool)

func Save

func Save[T any](ctx *Context, k InfoKey[T], v T)

Save stores a value, but only if it is not already set.

If the value is already set, it panics.

func Set

func Set[T any](ctx *Context, k InfoKey[T], v T)

Set is like save, but it will overwrite any existing value as well.

Types

type AnyInfoKey

type AnyInfoKey interface {
	// contains filtered or unexported methods
}

AnyInfoKey is a non-generic interface implemented exclusively by [InfoKey[T]]. It exists so that InfoKeys can be map keys.

type Context

type Context struct {
	context.Context
	// contains filtered or unexported fields
}

func NewContext

func NewContext(ctx context.Context) *Context

func (*Context) Value

func (ctx *Context) Value(key any) any

type InfoKey

type InfoKey[T any] struct {
	// contains filtered or unexported fields
}

func NewKey

func NewKey[T any](name string) InfoKey[T]

func (InfoKey[T]) Format

func (k InfoKey[T]) Format(f fmt.State, _ rune)

Format implements fmt.Formatter.

Jump to

Keyboard shortcuts

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