guard

package
v0.0.0-...-6b846f9 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(obj interface{}, names ...string) error

Check checks whether any of the given field names are not among a list of editable fields

func DBColumnsFrom

func DBColumnsFrom(obj interface{}) (columns []string)

DBColumnsFrom returns a slice of data field names declared via `db` tag NOTE: will only include fields with explicit `db` tag

func ListEditable

func ListEditable(obj interface{}) []string

ListEditable returns a list of editable fields for a given object

func ProcureDBChangesFromChangelog

func ProcureDBChangesFromChangelog(obj interface{}, changelog diff.Changelog) (changes map[string]interface{}, err error)

ProcureDBChangesFromChangelog produces a map of changes based on a given object and a changelog NOTE: this function does not check whether any of the changed fields are protected NOTE: returned keys are the data column names mapped with `db` TODO: move to data package

Types

This section is empty.

Jump to

Keyboard shortcuts

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