patch

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPatchPayload

func NewPatchPayload(operation string, path string, value interface{}) ([]byte, error)

NewPatchPayload constructs the patch payload fo any type of object.

Types

type ClientSet

type ClientSet struct {
	// kubeclientset is a standard kubernetes clientset
	Kubeclientset kubernetes.Interface
	// clientset is a openebs custom resource package generated for custom API group.
	OpenebsClientset clientset.Interface
}

ClientSet struct holds kubernetes and openebs clientsets.

type Patch

type Patch struct {
	// Op defines the operation
	Op string `json:"op"`
	// Path defines the key path
	// eg. for
	// {
	//  	"Name": "openebs"
	//	    Category: {
	//		  "Inclusive": "v1",
	//		  "Rank": "A"
	//	     }
	// }
	// The path of 'Inclusive' would be
	// "/Name/Category/Inclusive"
	Path  string      `json:"path"`
	Value interface{} `json:"value"`
}

Patch is the struct based on standards of JSON patch.

type Patcher

type Patcher interface {
	Patch(name string, nameSpace string, patchType types.PatchType, patches []byte) (interface{}, error)
}

Patcher interface has Patch function which can be implemented for several objects that needs to be patched.

Jump to

Keyboard shortcuts

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