Documentation ¶
Index ¶
- func DuplicateError(err error, size int) []error
- func FileExists(path string) (bool, error)
- func FindField(m map[string]interface{}, qualifiedField string) (interface{}, bool)
- func GenerateRandomKey(l int) (string, error)
- func GenerateRandomPassword(l int) (string, error)
- func GetYMDFromDatabaseDate(dateString string) string
- func Includes[T comparable](arr []T, against T) bool
- func IsBannedPassword(password string) bool
- func MD5FromBytes(data []byte) string
- func MD5FromFilePath(filePath string) (string, error)
- func MD5FromString(str string) string
- func ParseDateStringAsFormat(dateString string, format string) (string, error)
- func ParseDateStringAsTime(dateString string) (time.Time, error)
- func ProcessSlice[T comparable](current []T, added []T, removed []T) []T
- func ResolveEnum(value sql.NullString, out interface{}) bool
- func ResolveEnumString(value string, out interface{}) bool
- func SliceCompare[T comparable](subject []T, against []T) (added []T, missing []T)
- func StrPtrToString(val *string) string
- func StringToStrPtr(val string) *string
- func Touch(path string) error
- type ArgumentsQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DuplicateError ¶
func FileExists ¶
FileExists returns true if the given path exists
func FindField ¶
FindField traverses a json map, searching for the field matching the qualified field string provided.
For example: a qualifiedField of "foo" returns value of the "foo" key in the provided map. A qualifiedField of "foo.bar" will find the "foo" value, and if it is a map[string]interface{}, will return the "bar" value of that map. Returns the value and true if the value was found. Returns nil and false if the value was not found, or if one of the intermediate values was not a map[string]interface{}
func GenerateRandomKey ¶
func GenerateRandomPassword ¶
func GetYMDFromDatabaseDate ¶
func Includes ¶ added in v0.2.0
func Includes[T comparable](arr []T, against T) bool
func IsBannedPassword ¶
IsBannedPassword returns true if the password matches one from the banned password list.
func MD5FromBytes ¶
func MD5FromFilePath ¶
func MD5FromString ¶
func ParseDateStringAsFormat ¶
func ProcessSlice ¶ added in v0.2.0
func ProcessSlice[T comparable](current []T, added []T, removed []T) []T
func ResolveEnum ¶
func ResolveEnum(value sql.NullString, out interface{}) bool
func ResolveEnumString ¶
func SliceCompare ¶ added in v0.2.0
func SliceCompare[T comparable](subject []T, against []T) (added []T, missing []T)
func StrPtrToString ¶ added in v0.2.0
func StringToStrPtr ¶ added in v0.2.0
Types ¶
type ArgumentsQuery ¶ added in v0.4.0
type ArgumentsQuery struct {
// contains filtered or unexported fields
}
ArgumentsQuery to check whether arg value is null
func Arguments ¶ added in v0.4.0
func Arguments(ctx context.Context) (ret ArgumentsQuery)
Arguments query to check whether args value is null. https://github.com/99designs/gqlgen/issues/866
func (ArgumentsQuery) Field ¶ added in v0.4.0
func (a ArgumentsQuery) Field(name string) ArgumentsQuery
Field select field by name, returns a new query.
func (ArgumentsQuery) Index ¶ added in v0.4.0
func (a ArgumentsQuery) Index(index int) ArgumentsQuery
Index select field by array index, returns a new query.
func (ArgumentsQuery) IsNull ¶ added in v0.4.0
func (a ArgumentsQuery) IsNull() bool
IsNull return whether selected field value is null.