Documentation ¶
Index ¶
- Constants
- func IsJSONMergePatch(patcher cue.Value) bool
- func IsJSONPatch(patcher cue.Value) bool
- func ListOpen(expr ast.Node) ast.Node
- func OpenBaiscLit(s string) (string, error)
- func OptBytesToString(node ast.Node) ast.Node
- func PreprocessBuiltinFunc(root ast.Node, name string, process func(values []ast.Node) (ast.Expr, error)) error
- func StrategyUnify(base, patch string, options ...UnifyOption) (ret string, err error)
- func ToFile(n ast.Node) (*ast.File, error)
- func ToString(v cue.Value, opts ...func(node ast.Node) ast.Node) (string, error)
- type UnifyByJSONMergePatch
- type UnifyByJSONPatch
- type UnifyOption
- type UnifyParams
Constants ¶
View Source
const ( // TagPatchKey specify the primary key of the list items TagPatchKey = "patchKey" // TagPatchStrategy specify a strategy of the strategic merge patch TagPatchStrategy = "patchStrategy" // StrategyRetainKeys notes on the strategic merge patch using the retainKeys strategy StrategyRetainKeys = "retainKeys" // StrategyReplace notes on the strategic merge patch will allow replacing list StrategyReplace = "replace" // StrategyJSONPatch notes on the strategic merge patch will follow the RFC 6902 to run JsonPatch StrategyJSONPatch = "jsonPatch" // StrategyJSONMergePatch notes on the strategic merge patch will follow the RFC 7396 to run JsonMergePatch StrategyJSONMergePatch = "jsonMergePatch" )
Variables ¶
This section is empty.
Functions ¶
func IsJSONMergePatch ¶ added in v1.3.0
IsJSONMergePatch check if patcher is json merge patch
func IsJSONPatch ¶ added in v1.3.0
IsJSONPatch check if patcher is json patch
func OpenBaiscLit ¶ added in v1.1.1
OpenBaiscLit make that the basicLit can be modified.
func OptBytesToString ¶
OptBytesToString convert cue bytes to string.
func PreprocessBuiltinFunc ¶
func PreprocessBuiltinFunc(root ast.Node, name string, process func(values []ast.Node) (ast.Expr, error)) error
PreprocessBuiltinFunc preprocess builtin function in cue file.
func StrategyUnify ¶
func StrategyUnify(base, patch string, options ...UnifyOption) (ret string, err error)
StrategyUnify unify the objects by the strategy
Types ¶
type UnifyByJSONMergePatch ¶ added in v1.3.0
type UnifyByJSONMergePatch struct{}
UnifyByJSONMergePatch unify by json patch following RFC 7396
func (UnifyByJSONMergePatch) ApplyToOption ¶ added in v1.3.0
func (op UnifyByJSONMergePatch) ApplyToOption(params *UnifyParams)
ApplyToOption apply to option
type UnifyByJSONPatch ¶ added in v1.3.0
type UnifyByJSONPatch struct{}
UnifyByJSONPatch unify by json patch following RFC 6902
func (UnifyByJSONPatch) ApplyToOption ¶ added in v1.3.0
func (op UnifyByJSONPatch) ApplyToOption(params *UnifyParams)
ApplyToOption apply to option
type UnifyOption ¶ added in v1.3.0
type UnifyOption interface {
ApplyToOption(params *UnifyParams)
}
UnifyOption defines the option for unify
func CreateUnifyOptionsForPatcher ¶ added in v1.3.0
func CreateUnifyOptionsForPatcher(patcher cue.Value) (options []UnifyOption)
CreateUnifyOptionsForPatcher create unify options for patcher
type UnifyParams ¶ added in v1.3.0
type UnifyParams struct {
PatchStrategy string
}
UnifyParams params for unify
Click to show internal directories.
Click to hide internal directories.