Documentation ¶
Index ¶
- Variables
- func After(d time.Duration) *time.Time
- func CheckKeys(userRight int64, val func(key string) int64, keys ...string) bool
- func CheckVals(userRight int64, vals ...int64) bool
- func CreatePrivateKey(privateKeyPEM []byte) (*ecdsa.PrivateKey, error)
- func CreatePrivateKeyPEM() ([]byte, error)
- func CreatePublicKey(publicKeyPEM []byte) (*ecdsa.PublicKey, error)
- func CreatePublicKeyPEM(privateKey *ecdsa.PrivateKey) ([]byte, error)
- func DirExist(dir string) bool
- func FileExist(filename string) bool
- func FileSize(size int64) string
- func HomeDir(path string) (string, error)
- func Int(name string, val int) error
- func IsBool(attributeType string) bool
- func IsInt(goType string) bool
- func IsNumeric(attributeType string) bool
- func MakeCamel(val string) string
- func MakeCapitalize(str string) string
- func MakeKebab(val string) string
- func MakePlural(name string) string
- func MakeSafeString(val string) string
- func MakeSingle(name string) string
- func MakeSnake(val string) string
- func MakeStudly(val string) string
- func MakeTitle(val string) string
- func MakeUrl(val string) string
- func MatchAlphabet(val string) bool
- func MatchDomain(val string) bool
- func MatchEmail(val string) bool
- func MatchPhone(val string) bool
- func MySQLSplit(data []byte, atEOF bool) (advance int, token []byte, err error)
- func Now() *time.Time
- func RString(name string, val *string) error
- func RandomString(len int) (string, error)
- func ReadJSON(filename string, v interface{}) error
- func SqlFilter(filter string, str *strings.Builder, args *[]interface{}, prefix string, ...) error
- func SqlOrderBy(orderBy string, str *strings.Builder, prefix string, ...) error
- func String(name string, val string) error
- func TarFile(src string) (string, error)
- func TryParse(val string, attributeType string) (interface{}, error)
- func Uint64(name string, val uint64) error
- func ValidateDomain(domain ...string) error
- func ValidateEmail(email ...string) error
- func ValidateName(name ...string) error
- func ValidatePhone(phone ...string) error
- func Where(where string, fn func(key string, op string, val string))
- func WriteJSON(filename string, v interface{}, overwrite bool) error
- func ZipFile(src string) (string, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrDecodingPemBlock decoding PEM block error ErrDecodingPemBlock = errors.New("decoding PEM block error") // ErrConvertingEcPublicKey converting EC public key error ErrConvertingEcPublicKey = errors.New("converting EC public key error") )
Functions ¶
func CheckKeys ¶ added in v0.0.3
CheckKeys rbac check right by keys @param val func(key string) get value by key
func CreatePrivateKey ¶ added in v0.0.2
func CreatePrivateKey(privateKeyPEM []byte) (*ecdsa.PrivateKey, error)
CreatePrivateKey return *ecdsa.PrivateKey
func CreatePrivateKeyPEM ¶ added in v0.0.2
CreatePrivateKeyPEM create private key pem
func CreatePublicKey ¶ added in v0.0.2
CreatePublicKey return *ecdsa.PublicKey
func CreatePublicKeyPEM ¶ added in v0.0.2
func CreatePublicKeyPEM(privateKey *ecdsa.PrivateKey) ([]byte, error)
CreatePublicKeyPEM create public key pem
func MakeCamel ¶ added in v0.0.2
MakeCamel converts the given val to camel case like: user_key to userKey
func MakeCapitalize ¶ added in v0.0.2
MakeCapitalize change first character to upper
func MakeKebab ¶ added in v0.0.2
MakeKebab converts the given val to kebab case like: UserKey to user-key
func MakePlural ¶ added in v0.0.2
MakePlural convert word to plural
func MakeSafeString ¶ added in v0.0.2
MakeSafeString make string safe for sql
func MakeSingle ¶ added in v0.0.2
MakeSingle convert word to single
func MakeSnake ¶ added in v0.0.2
MakeSnake converts the given val to snake case like: UserKey,userKey to user_key
func MakeStudly ¶ added in v0.0.2
MakeStudly converts the given val to studly case like: user_key, userKey to UserKey
func MakeTitle ¶ added in v0.0.2
MakeTitle converts the given val to title case like: UserKey,userKey to user_key
func MatchAlphabet ¶ added in v0.0.2
MatchAlphabet check alphabet
func MySQLSplit ¶ added in v0.0.2
MySQLSplit split function for the Scanner
func SqlFilter ¶
func SqlFilter(filter string, str *strings.Builder, args *[]interface{}, prefix string, fn func(key string, val string) (string, interface{}, error)) error
SqlFilter create sql for filter and args
func SqlOrderBy ¶
func SqlOrderBy(orderBy string, str *strings.Builder, prefix string, fn func(variableName string) (string, string, string, error)) error
SqlOrderBy create sql for order by
func ValidateDomain ¶ added in v0.0.2
ValidateDomain validate domain
func ValidateEmail ¶ added in v0.0.2
ValidateEmail validate email
func ValidateName ¶ added in v0.0.2
ValidateName validate name
func ValidatePhone ¶ added in v0.0.2
ValidatePhone validate phone number
Types ¶
This section is empty.