edit

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_EDITOR   string = "vi"
	ENV_EDITOR       string = "EDITOR"
	ENV_KUBE_EDITOR  string = "KUBE_EDITOR"
	TMP_FILE_PATTERN string = "ephemeral-containers-*.yaml"
)

Variables

This section is empty.

Functions

func EditResource

func EditResource[r runtime.Object](ctx context.Context, editor string, obj r, result r) (r, error)

Edit a k8s resource and return the updated one

func GetEditorCmd

func GetEditorCmd(fromFlag string) string

Get editor executable from sources if not set on cli flags Precedence: * --editor flag * KUBE_EDITOR env var * EDITOR env var * Default to vi (vim)

func GetValueFromSources

func GetValueFromSources(sources ...func() string) string

Get value from multiple sources until a non-empty value is returned

func OpenEditorForFile

func OpenEditorForFile(ctx context.Context, editor, path string, args ...string) error

Execute editor command for a file path and await closing editor

Types

This section is empty.

Jump to

Keyboard shortcuts

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