Documentation ¶
Index ¶
- Constants
- Variables
- func AddQueryToURL(urlStr string, queryMap map[string]string) string
- func ContainsStr(s []string, v string) bool
- func EnsureDir(dir string) error
- func GetMD5Hash(text string) string
- func InitDB()
- func JsonObjInArrAnyStr(jsonStr string) string
- func Marked(markdownStr string) (string, error)
- func NewGormLogger() *gLogger
- func OpenCache() (err error)
- func OpenDB(dbType config.DBType, dsn string) (*gorm.DB, error)
- func OpenMySql(dsn string) (*gorm.DB, error)
- func OpenPostgreSQL(dsn string) (*gorm.DB, error)
- func OpenSQLite(filename string) (*gorm.DB, error)
- func OpenSqlServer(dsn string) (*gorm.DB, error)
- func RemoveBlankStrings(s []string) []string
- func RemoveDuplicates(arr []string) []string
- func SplitAndTrimSpace(s string, sep string) []string
- func StructToFlatDotMap(s interface{}) map[string]interface{}
- func StructToMap(s interface{}) map[string]interface{}
- func ToString(val interface{}) string
- func TruncateString(str string, length int) string
- func ValidateEmail(email string) bool
- func ValidateURL(url string) bool
Constants ¶
View Source
const ATK_SITE_ALL = "__ATK_SITE_ALL"
所有站点
View Source
const COOKIE_KEY_ATK_AUTH = "ATK_AUTH"
Cookie 键
View Source
const CTX_KEY_ATK_SITE_ALL = "atk_site_all"
View Source
const CTX_KEY_ATK_SITE_ID = "atk_site_id"
ctx keys
View Source
const CTX_KEY_ATK_SITE_NAME = "atk_site_name"
Variables ¶
View Source
var ( Version string CommitHash string )
版本信息
View Source
var (
CACHE *marshaler.Marshaler
)
View Source
var Ctx = context.Background()
View Source
var DB *gorm.DB
View Source
var FeMinVersion string = "2.4.3"
前端最小要求版本号
Functions ¶
func ContainsStr ¶
ContainsStr returns true if an str is present in a iteratee.
func GetMD5Hash ¶
func JsonObjInArrAnyStr ¶
将 JSON "数组中的"对象的 Values 全部转成 String 类型 @note Array style is not the same as JSON Array, it uses the ToString() function.
[{"a":233}, {"b":true}, {"c":"233"}] => [{"a":"233"}, {"b":"true"}, {"c":"233"}]
@relevant ToString()
func NewGormLogger ¶
func NewGormLogger() *gLogger
func RemoveBlankStrings ¶
func RemoveDuplicates ¶
RemoveDuplicates removes the duplicates strings from a Slice
func SplitAndTrimSpace ¶
func StructToFlatDotMap ¶
func StructToFlatDotMap(s interface{}) map[string]interface{}
func StructToMap ¶
func StructToMap(s interface{}) map[string]interface{}
func ToString ¶
func ToString(val interface{}) string
任何类型转 String
(bool) true => (string) "true" (int) 0 => (string) "0"
func TruncateString ¶
func ValidateEmail ¶
func ValidateURL ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.