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 MarshalModeEnum = []MarshalMode{MarshalModeYAML, MarshalModeJSON}
View Source
var SkipEditor = false
Functions ¶
func MarshalModeArgSpec ¶
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
Click to show internal directories.
Click to hide internal directories.