predictor

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: Apache-2.0 Imports: 12 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 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 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