patching

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

patching provides functionality to patch resources

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiffElem

type DiffElem struct {
	Old any
	New any
}

type FieldMapper

type FieldMapper struct {
	// contains filtered or unexported fields
}

func NewFieldMapper

func NewFieldMapper(v any) (*FieldMapper, error)

func (*FieldMapper) StructFieldName

func (f *FieldMapper) StructFieldName(tag string) (string, bool)

type PatchSet

type PatchSet struct {
	// contains filtered or unexported fields
}

func NewPatchSet

func NewPatchSet(data map[string]any) *PatchSet

func (*PatchSet) Fields

func (s *PatchSet) Fields() []string

func (*PatchSet) Set

func (s *PatchSet) Set(field string, value any)

type Patcher

type Patcher struct {
	// contains filtered or unexported fields
}

func NewSpannerPatcher

func NewSpannerPatcher() *Patcher

func (*Patcher) Diff

func (tm *Patcher) Diff(old any, patchSet *PatchSet) (map[string]DiffElem, error)

func (*Patcher) Resolve

func (tm *Patcher) Resolve(patchSet *PatchSet, databaseType any) (map[string]any, error)

Resolve returns a map with the keys set to the database struct tags found on databaseType, and the values set to the values in patchSet.

Jump to

Keyboard shortcuts

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