package
0.8.9
Repository: https://github.com/influx6/npkg.git
Documentation: pkg.go.dev

# Functions

CallFuncType attempts to call a giving function with provided arguments assuming all of them match the ff: 1.
CanSetFor checks if the giving val can be set in the place of the target type.
CanSetForType checks if a val reflect.Type can be used for the target type.
Convert takes a val and converts it into the target type provided if possible.
CopyBytes returns a new copy of giving byte slice.
CopyInterfaceKeyMap returns a new copy of a giving interface keyed map.
CopyStringKeyMap returns a new copy of a giving string keyed map.
CopyStringMap returns a new copy of a giving string map.
DeepCopy copies giving value returning a new distinct value, else an error due to failure.
DeepCopyValue uses the internal deepCopyValue function to make a copy of giving reflect value type adequately ensuring to return a pointer if a pointer value was giving to it else returning a value.
ExternalTypeNames returns the name and field names of the provided elem which must be a struct, excluding all internal types.
FuncType return the Function reflect.Type of the provided function else returns a non-nil error.
FuncValue return the Function reflect.Value of the provided function else returns a non-nil error.
GetFieldByTagAndValue returns a giving struct field which has giving tag and value pair.
GetFields retrieves all fields of the giving elements with the giving tag type.
GetFuncArgumentsType returns the arguments type of function which should be a function type,else returns a non-nil error.
GetFuncReturnsType returns the returns type of function which should be a function type,else returns a non-nil error.
GetTagFields retrieves all fields of the giving elements with the giving tag type.
HasArgumentSize return true/false to indicate if the function type has the size of arguments.
func IndirectType returns the reflect.Type if the provided value is a pointer kind.
func IndirectValue returns the reflect.Value if the provided value is a pointer kind.
InterfaceFromValues returns a list of interfaces representing the concrete values within the lists of reflect.Value types.
IsFuncType returns true/false if the interface provided is a func type.
No description provided by the author
No description provided by the author
IsSettable returns true/false if the element(elem) can be used for for ref type.
IsSettableType returns true/false if the element(elem) can be used for for ref type.
IsStrictlyAssignable returns true/false if the element(elem) can be used for for ref type.
IsStrictlyAssignableType returns true/false if the element(elem) is of for ref type.
IsStruct returns true/false if the elem provided is a type of struct.
No description provided by the author
No description provided by the author
MakeArgumentsValues takes a list of reflect.Types and returns a new version of those types, ensuring to dereference if it receives a pointer reflect.Type.
MakeNew returns a new version of the giving type, returning a nonpointer type.
MakeValueFor makes a new reflect.Value for the reflect.Type.
MatchElement attempts to validate that both element are equal in type and value.
MatchFuncArgumentTypeWithValues validates specific values matches the elems function arguments.
MatchFunction attempts to validate if giving types are functions and exactly match in arguments and returns.
MergeMap merges the key names of the provided map into the appropriate field place where the element has the provided tag.
No description provided by the author
NewStructMapper returns a new instance of StructMapper.
StrictCanSetForType checks if a val reflect.Type can be used for the target type.
TimeInverseMapper returns a InverseMapAdapter for time.Time values which turns incoming string values of time into Time.Time object.
TimeMapper returns a MapAdapter which always formats time into provided layout and returns the string version of the giving time.
ToMap returns a map of the giving values from a struct using a provided tag to capture the needed values, it extracts those tags values out into a map.
TypeAndFields returns the type of the giving element and a slice of all composed types.
TypeName returns the original typename of giving target.
TypeOf returns giving type of elem.
ValidateFunc validates giving function arguments and returns types against TypeValidation functions.
ValidateFuncArea validates giving function arguments and returns types against AreaValidation functions.
ValueOf returns giving value of elem, if elem is a reflect.Type returns a new reflect.Value for giving type.

# Variables

ErrInvalid is returned when a type fails certain conditions.
nerror ...
ErrNotFunction is returned when the type is not a reflect.Func.
ErrNotStruct is returned when the reflect type is not a struct.
ErrPanic is returned when a panic happens.

# Structs

Field defines a specific tag field with its details from a giving struct.
FieldType defines a struct which holds details the name and package which a giving field belongs to.
StructMapper implements a struct mapping utility which allows mapping struct fields to a map and vise-versa.

# Interfaces

Mapper defines an interface which exposes methods to map a struct from giving tags to a map and vise-versa.

# Type aliases

AreaValidation defines a function which validates a a given set against some condition.
Fields defines a lists of Field instances.
InverseMapAdapter defines a function type which takes a Field and concrete value returning appropriate go value or an error.
MapAdapter defines a function type which takes a Field returning a appropriate representation value or an error.
TypeValidation defines a function which validates a a given set against some condition.