Documentation ¶
Index ¶
- Constants
- Variables
- func AddSalt(input string) string
- func CheckPassword(inputPassword string, realPassword string) bool
- func CompareVersion(v1 string, v2 string) bool
- func FileIsExist(path string) bool
- func FileSize(size int64) string
- func GenerateToken() string
- func HmacSha1Encode(input string, key string) string
- func InputString(str *string, hint string)
- func MakeErrJSON(httpStatusCode int, errCode int, msg interface{}) (int, interface{})
- func MakeSuccessJSON(data interface{}) (int, interface{})
- func SSHExecute(ip string, port string, user string, password string, command string) (string, error)
- func Sha1Encode(input string) string
Constants ¶
View Source
const ( // Config DATBASE_VERSION = "database_version" TITLE_CONF = "title" FLAG_PREFIX_CONF = "flag_prefix" FLAG_SUFFIX_CONF = "flag_suffix" ANIMATE_ASTEROID = "animate_asteroid" SHOW_OTHERS_GAMEBOX = "show_others_gamebox" DEFAULT_LANGUAGE = "default_language" BOOLEAN_TRUE = "true" BOOLEAN_FALSE = "false" )
View Source
const ( // Config type STRING = iota BOOLEAN SELECT )
Variables ¶
View Source
var ( VERSION string COMMIT_SHA string BUILD_TIME string )
These variable will be assigned in CI.
Functions ¶
func CheckPassword ¶
CheckPassword adds salt and check the password.
func CompareVersion ¶
CompareVersion used to compare the cardinal version.
func HmacSha1Encode ¶
HmacSha1Encode HMAC SHA1 encode
func InputString ¶
InputString used in the install.go for the config file guide.
func MakeErrJSON ¶
MakeErrJSON makes the error response JSON for gin.
func MakeSuccessJSON ¶
func MakeSuccessJSON(data interface{}) (int, interface{})
MakeSuccessJSON makes the successful response JSON for gin.
func SSHExecute ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.