Documentation
¶
Index ¶
- func BoolOrPanic(res bool, err error) bool
- func ClearDirectory(dir string) error
- func ConcatStr(sep string, str ...string) string
- func CreateDirectory(path string) error
- func ExtractNumbers(str string) string
- func FileExists(path string) (bool, error)
- func FindFile(dir string, pattern string) []string
- func Float32OrPanic(res float32, err error) float32
- func Float64OrPanic(res float64, err error) float64
- func FormatNumber(format string, value int64) string
- func GetSubDirectory(dir string) ([]string, error)
- func HasError(err error) bool
- func Int16OrPanic(res int16, err error) int16
- func Int32OrPanic(res int32, err error) int32
- func Int64OrPanic(res int64, err error) int64
- func Int8OrPanic(res int8, err error) int8
- func IntOrPanic(res int, err error) int
- func InterfaceOrPanic(res interface{}, err error) interface{}
- func IsDirectory(path string) (bool, error)
- func IsErrorOf(tag string, err error) bool
- func IsValidOId(id *primitive.ObjectID) bool
- func MongoAnd(v interface{}) primitive.D
- func MongoArray(args ...interface{}) primitive.A
- func MongoDoc(args ...interface{}) primitive.D
- func MongoGroup(fields interface{}) primitive.D
- func MongoIn(k string, v interface{}) primitive.D
- func MongoLimit(limit uint) primitive.D
- func MongoLookup(from string, local string, foreign string, as string) primitive.D
- func MongoMap(args ...interface{}) primitive.M
- func MongoMaps(args ...interface{}) []primitive.M
- func MongoMatch(v interface{}) primitive.D
- func MongoMergeRoot(fields ...interface{}) primitive.D
- func MongoNestedSet(k string, v interface{}) primitive.D
- func MongoOr(v interface{}) primitive.D
- func MongoSet(v interface{}) primitive.D
- func MongoSetRoot(newRoot interface{}) primitive.D
- func MongoSkip(skip uint64) primitive.D
- func MongoSort(sorts interface{}) primitive.D
- func MongoUnProject(fields ...string) primitive.D
- func MongoUnwind(path string) primitive.D
- func MongoUnwrap(field string, as string) primitive.D
- func PanicOnError(err error)
- func ParseObjectID(id string) *primitive.ObjectID
- func RandomString(n uint) (string, error)
- func RandomStringFromCharset(n uint, letters string) (res string, err error)
- func Slugify(str ...string) string
- func StringOrPanic(res string, err error) string
- func TaggedError(tags []string, format string, args ...interface{}) error
- func UInt16OrPanic(res uint16, err error) uint16
- func UInt32OrPanic(res uint32, err error) uint32
- func UInt64OrPanic(res uint64, err error) uint64
- func UInt8OrPanic(res uint8, err error) uint8
- func UIntOrPanic(res uint, err error) uint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoolOrPanic ¶
BoolOrPanic get function result (bool, error) if error is not null generate panic otherwise return result
func ClearDirectory ¶
ClearDirectory delete all files and sub-directory in directory
func CreateDirectory ¶
CreateDirectory create nested directory
func ExtractNumbers ¶
ExtractNumbers extract numbers from string
func Float32OrPanic ¶
Float32OrPanic get function result (float32, error) if error is not null generate panic otherwise return result
func Float64OrPanic ¶
Float64OrPanic get function result (float64, error) if error is not null generate panic otherwise return result
func FormatNumber ¶ added in v1.3.0
FormatNumber format number with comma separator
func GetSubDirectory ¶
GetSubDirectory get list of sub directories
func Int16OrPanic ¶
Int16OrPanic get function result (int16, error) if error is not null generate panic otherwise return result
func Int32OrPanic ¶
Int32OrPanic get function result (int32, error) if error is not null generate panic otherwise return result
func Int64OrPanic ¶
Int64OrPanic get function result (int64, error) if error is not null generate panic otherwise return result
func Int8OrPanic ¶
Int8OrPanic get function result (int8, error) if error is not null generate panic otherwise return result
func IntOrPanic ¶
IntOrPanic get function result (int, error) if error is not null generate panic otherwise return result
func InterfaceOrPanic ¶
func InterfaceOrPanic(res interface{}, err error) interface{}
InterfaceOrPanic get function result (interface{}, error) if error is not null generate panic otherwise return result
func IsDirectory ¶
IsDirectory check if path is directory
func IsValidOId ¶ added in v1.2.0
IsValidOId check if object id is valid and not zero
func MongoArray ¶ added in v1.3.0
MongoArray generate primitive.A
func MongoDoc ¶ added in v1.2.0
MongoDoc generate primitive.D from args
Args count must even Example: MongoDoc("_id", 1, "name", "John")
func MongoGroup ¶ added in v1.2.0
MongoGroup generate $group
func MongoLimit ¶ added in v1.2.0
MongoLimit generate $limit
func MongoLookup ¶ added in v1.2.0
MongoLookup generate $lookup
func MongoMatch ¶ added in v1.2.0
MongoMatch generate $match
func MongoMergeRoot ¶ added in v1.2.0
MongoMergeRoot generate $replaceRoot with $mergeObject
func MongoNestedSet ¶ added in v1.2.0
MongoNestedSet generate nested $set
func MongoSetRoot ¶ added in v1.2.0
MongoSetRoot generate $replaceRoot
func MongoUnProject ¶ added in v1.2.0
MongoUnProject generate $project to remove fields from result
func MongoUnwind ¶ added in v1.2.0
MongoUnwind generate $unwind (with preserveNull)
func MongoUnwrap ¶ added in v1.2.0
MongoUnwrap get first item of array and insert to doc using $addFields.
func ParseObjectID ¶ added in v1.2.0
ParseObjectID parse object id from string
@returns ObjectID @fail nil
func RandomString ¶
RandomString generate random string from Alpha-Num Chars
func RandomStringFromCharset ¶
RandomStringFromCharset generate random string from character list
func StringOrPanic ¶
StringOrPanic get function result (string, error) if error is not null generate panic otherwise return result
func TaggedError ¶ added in v1.3.0
TaggedError generate a tagged error
func UInt16OrPanic ¶
UInt16OrPanic get function result (uint16, error) if error is not null generate panic otherwise return result
func UInt32OrPanic ¶
UInt32OrPanic get function result (uint32, error) if error is not null generate panic otherwise return result
func UInt64OrPanic ¶
UInt64OrPanic get function result (uint64, error) if error is not null generate panic otherwise return result
func UInt8OrPanic ¶
UInt8OrPanic get function result (uint8, error) if error is not null generate panic otherwise return result
func UIntOrPanic ¶
UIntOrPanic get function result (uint, error) if error is not null generate panic otherwise return result
Types ¶
This section is empty.