predictor

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package predictor provides shell completion predictors for nctl resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient added in v1.12.2

func NewClient(ctx context.Context, defaultAPICluster string) (*api.Client, error)

NewClient creates an API client configured for shell completion. It uses a static token since dynamic exec config breaks with some shells during completion.

func NewInstanceDatabases added in v1.18.0

func NewInstanceDatabases(client *api.Client, gvk schema.GroupVersionKind) complete.Predictor

NewInstanceDatabases returns a predictor that completes database names for a dedicated instance resource. It fetches the instance named by the first positional argument on the command line and returns the keys of its status.atProvider.databases map.

func NewResourceName

func NewResourceName(client *api.Client) complete.Predictor

NewResourceName returns a predictor that infers the resource kind from the command arguments.

func NewResourceNameWithKind added in v1.9.0

func NewResourceNameWithKind(client *api.Client, gvk schema.GroupVersionKind) complete.Predictor

NewResourceNameWithKind returns a predictor for a specific resource kind.

Types

type InstanceDatabases added in v1.18.0

type InstanceDatabases struct {
	// contains filtered or unexported fields
}

InstanceDatabases is a predictor that completes database names for a dedicated database instance (e.g. Postgres, MySQL) by reading the Databases map from its status.

func (*InstanceDatabases) Predict added in v1.18.0

func (d *InstanceDatabases) Predict(args complete.Args) []string

Predict returns the database names available on the instance whose name appears as the first positional argument in the completion context.

type Resource

type Resource struct {
	// contains filtered or unexported fields
}

Resource is a predictor that completes resource names by querying the API.

func (*Resource) Predict

func (r *Resource) Predict(args complete.Args) []string

Predict returns a list of resource names for shell completion.

Jump to

Keyboard shortcuts

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