Documentation ¶
Index ¶
- Constants
- Variables
- func ChooseItem(items []*WeightItem) (selectedIndex int)
- func ConvertFloatToString(f float32) string
- func ConvertIntToString(i int) string
- func ConvertStrToInt(s string) int
- func DivisionInt(first int, second int) float32
- func EscapeCtrl(ctrl []byte) (esc []byte)
- func GenerateBid(prefix string) string
- func GenerateOTP() string
- func GenerateOrderNumber(purchaseType string) string
- func GenerateSecurityToken(mobileNumber string) string
- func GenerateSequenceNumberForOTP(otp string) string
- func GetBytes(key interface{}) ([]byte, error)
- func GetCachePool() *redis.Pool
- func GetCurrentTime() string
- func GetMd5String(s string) string
- func GetQueuePool() *redis.Pool
- func GetRandomNumber(min, max int) int
- func NewPool(server, password string) *redis.Pool
- func Pwdhash(str string) string
- func SetCachePool(pool *redis.Pool)
- func SetQueuePool(pool *redis.Pool)
- func StringsToJson(str string) string
- func Strtomd5(s string) string
- func SubString(str string, begin, length int) (substr string)
- type Funcs
- type HashSet
- type SysError
- type WeightItem
Constants ¶
View Source
const ADSPACE_STATUS_RUNNING = 0
View Source
const ADSPACE_STATUS_STOP = 1
View Source
const CREATIVE_TYPE_HTML = 3
View Source
const ERROR_AD_EXPIRED = 420
View Source
const ERROR_BD_FAILED_RES = 802
View Source
const ERROR_BD_MARSHAL_REQ = 800
View Source
const ERROR_BD_MARSHAL_RES = 803
View Source
const ERROR_BD_SERVER = 801
View Source
const ERROR_CAMPAIGN_DB_ERROR = 604
View Source
const ERROR_ILLEGAL_ADSPACE = 401
View Source
const ERROR_ILLEGAL_SERVER_IP = 407
View Source
const ERROR_INITIAL_FAILED = 603
View Source
const ERROR_MAP_ERROR = 703
View Source
const ERROR_MHSERVER_ERROR = 702
View Source
const ERROR_MSGPACK_IMP = 602
View Source
const ERROR_NOAD = 405
View Source
const ERROR_NO_AD = 400
View Source
const ERROR_NO_AD_FROM_QUEUE = 707
View Source
const ERROR_NO_DEMAND_ERROR = 705
View Source
const ERROR_NO_PMP_ADSPACE_ERROR = 706
View Source
const ERROR_NO_TEMPLATE = 421
View Source
const ERROR_PARSE_REQUEST = 601
View Source
const ERROR_REQUIRED_FIELD_MISSING = 406
View Source
const ERROR_TIMEOUT_ERROR = 704
View Source
const ERROR_UNKNON_ERROR = 701
View Source
const STATUS_SUCCESS = 200
Variables ¶
View Source
var (
ErrParamsNotAdapted = errors.New("The number of params is not adapted.")
)
View Source
var PoolCache *redis.Pool
View Source
var PoolQueue *redis.Pool
Functions ¶
func ChooseItem ¶
func ChooseItem(items []*WeightItem) (selectedIndex int)
func ConvertFloatToString ¶
func ConvertIntToString ¶
func ConvertStrToInt ¶
func DivisionInt ¶
func EscapeCtrl ¶
func GenerateBid ¶
func GenerateOrderNumber ¶
生成订单号 REQ: 询价单 RES: 报价单 TRX: 订单
func GenerateSecurityToken ¶
生成Security token
func GenerateSequenceNumberForOTP ¶
生成OTP Sequence Number
func GetCachePool ¶
func GetQueuePool ¶
func GetRandomNumber ¶
func SetCachePool ¶
func SetQueuePool ¶
func StringsToJson ¶
Types ¶
type HashSet ¶
type HashSet struct {
// contains filtered or unexported fields
}
func NewHashSet ¶
func NewHashSet() *HashSet
Click to show internal directories.
Click to hide internal directories.