editor

package
v2.25.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MarshalModeYAML = MarshalMode("yaml")
	MarshalModeJSON = MarshalMode("json")
)

Variables

View Source
var LongDescription = `` /* 174-byte string literal not displayed */
View Source
var MarshalModeDefault = MarshalModeYAML
View Source
var SkipEditor = false

Functions

func MarshalModeArgSpec

func MarshalModeArgSpec() *core.ArgSpec

func UpdateResourceEditor

func UpdateResourceEditor(resource interface{}, updateRequest interface{}, cfg *Config) (interface{}, error)

UpdateResourceEditor takes a complete resource and a partial updateRequest will return a copy of updateRequest that has been edited Only edited fields will be present in returned updateRequest If putRequest is true, all fields will be present, edited or not

Types

type Config

type Config struct {
	// PutRequest means that the request replace all fields
	// If false, fields that were not edited will not be sent
	// If true, all fields will be sent
	PutRequest bool

	MarshalMode MarshalMode

	// Template is a template that will be shown before marshaled data in edited file
	Template string

	// IgnoreFields is a list of json tags that will be removed from marshaled data
	// The content of these fields will be lost in edited data
	IgnoreFields []string
	// contains filtered or unexported fields
}

type GetResourceFunc

type GetResourceFunc func(interface{}) (interface{}, error)

type MarshalMode

type MarshalMode = string

Jump to

Keyboard shortcuts

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