patch

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package patch provides an implementation of the IPLD Patch specification. IPLD Patch is a system for declaratively specifying patches to a document, which can then be applied to produce a new, modified document.

This package is EXPERIMENTAL; its behavior and API might change as it's still in development.

Index

Constants

View Source
const (
	Op_Add     = "add"
	Op_Remove  = "remove"
	Op_Replace = "replace"
	Op_Move    = "move"
	Op_Copy    = "copy"
	Op_Test    = "test"
)

Variables

This section is empty.

Functions

func Eval

func Eval(n datamodel.Node, ops []Operation) (datamodel.Node, error)

func EvalOne

func EvalOne(n datamodel.Node, op Operation) (datamodel.Node, error)

Types

type Op

type Op string

type Operation

type Operation struct {
	Op    Op             // Always required.
	Path  datamodel.Path // Always required.
	Value datamodel.Node // Present on 'add', 'replace', 'test'.
	From  datamodel.Path // Present on 'move', 'copy'.
}

func Parse

func Parse(r io.Reader, dec codec.Decoder) ([]Operation, error)

func ParseBytes

func ParseBytes(b []byte, dec codec.Decoder) ([]Operation, error)

Jump to

Keyboard shortcuts

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