variables

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeManual        = "manual"
	StorageTypeValkey = "mdai-valkey"
)

Variables

View Source
var (
	ErrFetchFailed       = HTTPError{"failed to fetch variables", http.StatusInternalServerError}
	ErrDecodeFailed      = HTTPError{"failed to decode variables", http.StatusInternalServerError}
	ErrNoVariablesFound  = HTTPError{"no variables found for hub", http.StatusNotFound}
	ErrVariableNotFound  = HTTPError{"variable not found", http.StatusNotFound}
	ErrVariableNotManual = HTTPError{"only manual variables can be updated or deleted", http.StatusConflict}
)

Functions

This section is empty.

Types

type ByHub

type ByHub map[string]HubVariables

func DecodeByHub

func DecodeByHub(rawByHub map[string]map[string]string) (ByHub, error)

type Definition

type Definition struct {
	Name         string
	Schema       Schema
	Type         string
	DataType     datacorevariables.DataType
	StorageType  string
	VariableRefs []string
	Default      json.RawMessage // nil ⇔ no default declared
}

func GetVariable

func GetVariable(varName string, rawHubVariables map[string]string) (Definition, error)

func (Definition) IsManual

func (d Definition) IsManual() bool

type HTTPError

type HTTPError struct {
	Msg    string
	Status int
}

func (HTTPError) Error

func (e HTTPError) Error() string

func (HTTPError) HTTPStatus

func (e HTTPError) HTTPStatus() int

type HubDefinitions

type HubDefinitions map[string]Definition

func DecodeHubDefinitions

func DecodeHubDefinitions(rawHubVariables map[string]string) (HubDefinitions, error)

DecodeHubDefinitions fails fast on the first invalid schema to keep error handling simple. If partial decoding is needed in the future, we can introduce a Partial variant that collects errors per variable.

type HubVariables

type HubVariables map[string]Schema

func DecodeHub

func DecodeHub(rawHubVariables map[string]string) (HubVariables, error)

type Schema

type Schema = json.RawMessage

Schema is the raw JSON bytes of a single variable's schema entry, as written by the operator into the schema ConfigMap. It is forwarded verbatim in list-variables responses.

Jump to

Keyboard shortcuts

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