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
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 ¶
func (HTTPError) HTTPStatus ¶
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 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.
Click to show internal directories.
Click to hide internal directories.