patch

package
v0.0.0-...-60a913f Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2015 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Test

func Test(patches []Patch) (int, error)

Test partially implements http://tools.ietf.org/html/rfc6902

Patch examples: { "op": "test", "path": "/a/b/c", "value": "foo" }, { "op": "remove", "path": "/a/b/c" }, { "op": "add", "path": "/a/b/c", "value": [ "foo", "bar" ] }, { "op": "replace", "path": "/a/b/c", "value": 42 }, { "op": "move", "from": "/a/b/c", "path": "/a/b/d" }, { "op": "copy", "from": "/a/b/d", "path": "/a/b/e" }

Types

type Patch

type Patch struct {
	Operation string         `json:"op"`
	Path      string         `json:"path"`
	From      string         `json:"from,omitempty"`
	RawValue  interface{}    `json:"value,omitempty"`
	Bool      sql.NullBool   `json:"-"`
	String    sql.NullString `json:"-"`
	Int64     sql.NullInt64  `json:"-"`
	Time      pq.NullTime    `json:"-"`
}

Patch describes a JSON PATCH

func (*Patch) Scan

func (p *Patch) Scan() (int, error)

Scan hydrates a Patch with the value in the operation

Jump to

Keyboard shortcuts

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