Documentation ¶
Overview ¶
Package interfaces contains methods for copying data between interfaces.
Index ¶
- func CalculateDiff(before interface{}, after interface{}) map[string]string
- func GetAPIFieldNames(input interface{}) []string
- func GetFieldNames(input interface{}) []string
- func GetFieldValue(value interface{}, fieldName string) interface{}
- func GetTagFieldNames(input interface{}, tag string) []string
- func GetTagValue(tags string, targetTagName string) (tagValue string, exists bool, err error)
- func Inherit(output interface{}, ancestors []interface{}) error
- func InheritWithTag(output interface{}, ancestors []interface{}, tagName string) error
- func InjectVariables(input string, variables map[string]interface{}) (interface{}, error)
- func Overwrite(output interface{}, ancestors []interface{}) error
- func OverwriteWithTag(output interface{}, ancestors []interface{}, tagName string) error
- func ParseTypedValue(dataString string) reflect.Value
- func SetEnvFieldValues(output interface{}) error
- func SetQueryFields(input interface{}, queryValues map[string]string, allValues *bytes.Buffer) error
- func Sprint(input interface{}) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateDiff ¶
CalculateDiff calculates the difference between two objects.
func GetAPIFieldNames ¶
func GetAPIFieldNames(input interface{}) []string
GetAPIFieldNames returns the names of all fields of an object with an "api" tag.
func GetFieldNames ¶
func GetFieldNames(input interface{}) []string
GetFieldNames returns the names of all fields of an object.
func GetFieldValue ¶
func GetFieldValue(value interface{}, fieldName string) interface{}
GetFieldValue returns the value of a named field.
func GetTagFieldNames ¶
GetTagFieldNames returns the names of all fields of an object.
func GetTagValue ¶
GetTagValue returns whether the tag exists. If so, its value.
func Inherit ¶
func Inherit(output interface{}, ancestors []interface{}) error
Inherit inherits values from each ancestor if the output values are their defaults.
func InheritWithTag ¶
InheritWithTag inherits values from each ancestor if the output values are their defaults, only if the tag exists.
func InjectVariables ¶
InjectVariables injects input variables into a formatted string.
func Overwrite ¶
func Overwrite(output interface{}, ancestors []interface{}) error
Overwrite overwrites values in output using values from each ancestor. Equivalent to Inherit without the default checks.
func OverwriteWithTag ¶
OverwriteWithTag inherits values from each ancestor if the output values are not their defaults, only if the tag exists. Equivalent to InheritWithTag without the default checks.
func ParseTypedValue ¶
ParseTypedValue attempts to parse the underlying type of a string.
func SetEnvFieldValues ¶
func SetEnvFieldValues(output interface{}) error
SetEnvFieldValues sets field values based on environment variables.
Types ¶
This section is empty.
Source Files ¶
- interfaces.calculatediff.go
- interfaces.getfieldnames.go
- interfaces.getfieldvalue.go
- interfaces.gettag.go
- interfaces.go
- interfaces.inherit.go
- interfaces.injectvariables.go
- interfaces.overwrite.go
- interfaces.parsetypedvalue.go
- interfaces.setenvfieldvalues.go
- interfaces.setqueryfields.go
- interfaces.sprint.go