Documentation
¶
Index ¶
- Constants
- Variables
- func Copy(dest interface{}, src interface{}) error
- func GenerateCode(prefix string) string
- func HashPassword(pass []byte) (string, error)
- func JSONMarshalToString(v interface{}) string
- func PrepareResponse(data interface{}, message string, code string) map[string]interface{}
- func RandomString(length int) string
- func Validate(values []Validation) bool
- type Validation
Constants ¶
View Source
const ( Charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" RandLength = 5 )
constants generator
View Source
const ( Success = "200" Error = "500" InvalidParams = "400" ErrorGetDatabase = "1001" ErrorExistProduct = "10001" ErrorExistProductFail = "10002" ErrorNotExistProduct = "10003" ErrorGetProductsFail = "10004" ErrorCountProductFail = "10005" ErrorAddProductFail = "10006" ErrorEditProductFail = "10007" ErrorDeleteProductFail = "10008" ErrorExportProductFail = "10009" ErrorImportProductFail = "10010" ErrorNotExistUser = "20001" ErrorCheckExistUserFail = "20002" ErrorAddUserFail = "20003" ErrorDeleteUserFail = "20004" ErrorEditUserFail = "20005" ErrorCountUserFail = "20006" ErrorGetUsersFail = "20007" ErrorGetUserFail = "20008" ErrorGenUserPosterFail = "20009" ErrorAuthCheckTokenFail = "30001" ErrorAuthCheckTokenTimeout = "30002" ErrorAuthToken = "30003" ErrorAuth = "30004" )
constants responses
Variables ¶
View Source
var ( JSONMarshal = json.Marshal JSONUnmarshal = json.Unmarshal JSONMarshalIndent = json.MarshalIndent JSONNewDecoder = json.NewDecoder JSONNewEncoder = json.NewEncoder )
JSON
Functions ¶
func GenerateCode ¶
GenerateCode generate code by prefix, datetime
func PrepareResponse ¶
PrepareResponse return new response body type map
func RandomString ¶
RandomString random string by charset and length
Types ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.