ops

package
v1.1.37 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsZeroOfUnderlyingType

func IsZeroOfUnderlyingType(x interface{}) bool

func JsonPathRead

func JsonPathRead(value interface{}, path string) (interface{}, error)

JsonPathRead a path from a decoded JSON array or object ([]interface{} or unstructured.Unstructured) and returns the corresponding value or an error.

The returned value type depends on the requested path and the JSON value.

func WalkUnstructured

func WalkUnstructured(body interface{}, visitor func(value interface{}) (interface{}, error)) (interface{}, error)

Types

type Executor

type Executor struct {
	Params ExecutorParams
	// contains filtered or unexported fields
}

func (*Executor) Init

func (e *Executor) Init(ctx context.Context) error

func (*Executor) RestoreItem

func (e *Executor) RestoreItem(ctx context.Context, body unstructured.Unstructured) error

type ExecutorParams

type ExecutorParams struct {
	DhClient       client.DhClient
	OverrideConfig OverrideConfig
	DoMigration    bool
	ForceMigration bool
	DataOnly       bool
}

type JsonPathFilterFunc

type JsonPathFilterFunc func(value interface{}) (interface{}, error)

JsonPathFilterFunc applies a prepared json path to a JSON decoded value

func JsonPathPrepare

func JsonPathPrepare(path string) (JsonPathFilterFunc, error)

JsonPathPrepare will parse the path and return a filter function that can then be applied to decoded JSON values.

type OverrideConfig

type OverrideConfig struct {
	Namespace  string
	DataSource string
}

type ParserFunc

type ParserFunc func(reader io.Reader, consumer func(data unstructured.Unstructured) error) error

type Writer

type Writer struct {
	Annotations map[string]string
}

func (*Writer) WriteRecord

func (w *Writer) WriteRecord(namespace string, resourceName string, record *model.Record) (unstructured.Unstructured, error)

func (*Writer) WriteResource

func (w *Writer) WriteResource(resource *model.Resource) (unstructured.Unstructured, error)

Jump to

Keyboard shortcuts

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