Documentation
¶
Index ¶
- type CypressPatchTarget
- func (t *CypressPatchTarget) ApplyPatch(ctx context.Context, path ypath.Path, patch Patch) error
- func (t *CypressPatchTarget) ApplyPatchSet(ctx context.Context, path ypath.Path, patchSet PatchSet) error
- func (t *CypressPatchTarget) SetNode(ctx context.Context, dst ypath.YPath, value any, options *yt.SetNodeOptions) error
- type Patch
- type PatchOp
- type PatchOperation
- func Add(path ypath.Path, value any) PatchOperation
- func Copy(path, from ypath.Path) PatchOperation
- func Move(path, from ypath.Path) PatchOperation
- func Remove(path ypath.Path) PatchOperation
- func Replace(path ypath.Path, value any) PatchOperation
- func ReplaceOrRemove[T any](path ypath.Path, value *T) PatchOperation
- func Test(path ypath.Path, value any) PatchOperation
- type PatchOptions
- type PatchSet
- type PatchTarget
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CypressPatchTarget ¶
type CypressPatchTarget struct {
Client yt.CypressClient
DryRun bool
}
func (*CypressPatchTarget) ApplyPatch ¶
func (*CypressPatchTarget) ApplyPatchSet ¶
type Patch ¶
type Patch []PatchOperation
Patch represents patch with RFC-6902 json patch semantics.
func BuildPatch ¶
func BuildPatch(before, after any, options *PatchOptions) Patch
BuildPatch constructs (mostly correct) patch to convert "before" into "after".
type PatchOperation ¶
type PatchOperation struct {
Op PatchOp `json:"op" yson:"op"`
Path ypath.Path `json:"path" yson:"path"`
From ypath.Path `json:"from,omitempty" yson:"from,omitempty"`
Value any `json:"value,omitempty" yson:"value,omitempty"`
}
func Copy ¶
func Copy(path, from ypath.Path) PatchOperation
func Move ¶
func Move(path, from ypath.Path) PatchOperation
func Remove ¶
func Remove(path ypath.Path) PatchOperation
func ReplaceOrRemove ¶
func ReplaceOrRemove[T any](path ypath.Path, value *T) PatchOperation
type PatchOptions ¶
type PatchOptions struct {
WithTest bool
}
type PatchSet ¶
PatchSet represents series of patches which are applied lexicographically. NOTE: "<>//..." is applied after all "//...".
func (PatchSet) AddPatchSet ¶
Click to show internal directories.
Click to hide internal directories.