Documentation ¶
Index ¶
- Constants
- Variables
- func CloneSession() *mgo.Session
- func Get() (*mgo.Session, *mgo.Database)
- func GetCurrentDirectory() string
- func GetNewUID() (int64, error)
- func GetStatusMessage(status int) string
- func HandleError(err error) int
- func Int64ToString(i int64) string
- func IntToString(i int) string
- func MD5(s string) string
- func ToInt32(s string) (bool, int, error)
- func ToInt64(s string) (bool, int64, error)
- func ToObjectID(s string) (bson.ObjectId, error)
Constants ¶
View Source
const ( StatusSuccess = 0 StatusBad = 400 StatusNoAuth = 401 StatusForbidden = 403 StatusNotFound = 404 StatusUnknown = 500 )
Status Code
Variables ¶
View Source
var ( ConfigIsLocal = false ConfigIsDevelop = true ConfigIsProduct = false ConfigIsDebug = true || ConfigIsLocal ConfigIsRelease = !ConfigIsDebug )
Server Configuration
View Source
var ( ConfigIsDB = false DbConnMongo = "mongodb://localhost:27017" )
MongoDB Configuration
View Source
var GlobalMgoSession *mgo.Session
GlobalMgoSession :
View Source
var Log = logging.MustGetLogger("example")
Log :Global Log Instance
Functions ¶
func GetCurrentDirectory ¶
func GetCurrentDirectory() string
GetCurrentDirectory :Get current running directory
func GetStatusMessage ¶
GetStatusMessage :Handle all status code, return status message
func HandleError ¶
HandleError :Handle all errors, return status code
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.