Documentation ¶
Index ¶
- Variables
- func Arg(kind ArgKind, args ...string) (string, error)
- func Cluster(name string) *corev1.ClusterCapability
- func Has[T corev1.MetadataAccessor[U], U corev1.Capability[U]](accessor T, capability U) bool
- func NewBackend(client capability.BackendClient) capability.Backend
- func RenderInstallerCommand(tmpl string, spec InstallerTemplateSpec) (string, error)
- type ArgKind
- type ArgSpec
- type BackendStore
- type InputSpec
- type Installer
- type InstallerTemplateSpec
- type OptionSpec
- type SelectSpec
- type ServerInstallerTemplateSpec
- type ToggleSpec
- type TokenCapabilities
- type UserInstallerTemplateSpec
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBackendNotFound = fmt.Errorf("backend not found") ErrBackendAlreadyExists = fmt.Errorf("backend already exists") )
View Source
var ErrUnknownCapability = errors.New("unknown capability")
Functions ¶
func Arg ¶
Arg generates a JSON string that the UI can parse to generate input controls (text boxes, combo boxes, etc.) for the user to fill in. The values the user provides will be substituted into the install command for the user to copy.
Usage: {{ arg <kind> [args...] [+option ...] }} The args are specific to each kind of input control.
Kinds:
"input": A text box. Arguments: 1: Label "select": A combo box. Arguments: 1: Label 2+: Combo box items "toggle": A checkbox. Arguments: 1: Label
Options:
"+format:<value>": Controls how the value is substituted into the install command. Within the format text, {{ value }} will be replaced with the user input. Defaults to '{{ value }}' "+required": Marks the input is required. "+omitEmpty": If the value is "falsy" ('', 'false', etc), the argument will be omitted from the install command. "+default:<value>": Adds a default value to the input.
func Cluster ¶
func Cluster(name string) *corev1.ClusterCapability
func Has ¶
func Has[T corev1.MetadataAccessor[U], U corev1.Capability[U]]( accessor T, capability U, ) bool
func NewBackend ¶
func NewBackend(client capability.BackendClient) capability.Backend
func RenderInstallerCommand ¶
func RenderInstallerCommand(tmpl string, spec InstallerTemplateSpec) (string, error)
Types ¶
type ArgSpec ¶
type ArgSpec struct { Kind ArgKind `json:"kind"` Input *InputSpec `json:"input,omitempty"` Select *SelectSpec `json:"select,omitempty"` Toggle *ToggleSpec `json:"toggle,omitempty"` Options []OptionSpec `json:"options,omitempty"` }
type BackendStore ¶
type BackendStore interface { Get(name string) (capability.Backend, error) Add(name string, backend capability.Backend) error List() []string RenderInstaller(name string, spec UserInstallerTemplateSpec) (string, error) CanInstall(capabilities ...string) error InstallCapabilities(cluster *corev1.Reference, capabilities ...string) UninstallCapabilities(cluster *corev1.Reference, capabilities ...string) error }
func NewBackendStore ¶
func NewBackendStore(serverSpec ServerInstallerTemplateSpec, logger *zap.SugaredLogger) BackendStore
type InstallerTemplateSpec ¶
type InstallerTemplateSpec struct { UserInstallerTemplateSpec ServerInstallerTemplateSpec }
type OptionSpec ¶
type SelectSpec ¶
type ToggleSpec ¶
type ToggleSpec struct {
Label string `json:"label"`
}
type TokenCapabilities ¶
type TokenCapabilities string
const (
JoinExistingCluster TokenCapabilities = "join_existing_cluster"
)
func (TokenCapabilities) For ¶
func (tc TokenCapabilities) For(ref *corev1.Reference) *corev1.TokenCapability
Click to show internal directories.
Click to hide internal directories.