Documentation ¶
Index ¶
- Constants
- func AliyunGetPassword(sk string) string
- func AliyunGetUserName(ak string, resourceOwnerId uint64) string
- func AliyunGetUserNameBySTSToken(ak string, resourceOwnerId uint64, stsToken string) string
- func CheckSum(src []byte) []byte
- func DecodeMap(src interface{}, target interface{}) error
- func GenSignedURLPair(ossBucket *oss.Bucket, messageType MessageType, imageId string, ...) (string, string, error)
- func HexString(src []byte) string
- func HmacSha1(keyStr string, message string) string
- func MapKeys(syncMap *sync.Map) []interface{}
- func MapLen(syncMap *sync.Map) int
- func NewAuthError(err error) error
- func NewClientError(code ClientErrorCode, err error) error
- func NewRedisPool(server string, db string, password string) *redis.Pool
- func PasswordCheckSum(pass string) string
- func StringNull(str string, defaultValue string) sql.NullString
- type AuthChildUser
- type AuthError
- type AuthUser
- type ClientError
- type ClientErrorCode
- type CommonResponse
- type DatabaseConfig
- type ErrorHandler
- func (ctx *ErrorHandler) BJTimeFromUnix(timestamp int64) time.Time
- func (ctx *ErrorHandler) FromJson(jsonstr string) map[string]interface{}
- func (ctx *ErrorHandler) FromMap(key string, m map[string]interface{}, objname string, defValue interface{}) interface{}
- func (ctx *ErrorHandler) FromMapFloat(key string, m map[string]interface{}, objname string, haveDefault bool, ...) float64
- func (ctx *ErrorHandler) FromMapInt(key string, m map[string]interface{}, objname string, haveDefault bool, ...) int64
- func (ctx *ErrorHandler) FromMapString(key string, m map[string]interface{}, objname string, haveDefault bool, ...) string
- func (ctx *ErrorHandler) FromXML(xmlstr string, target interface{})
- func (ctx *ErrorHandler) GetResponseBody(resp *httpx.RestfulResponse) map[string]interface{}
- func (o *ErrorHandler) ListValue(value interface{}, hasDefault bool, defValue []interface{}) []interface{}
- func (o *ErrorHandler) NewMongoConn(host string, port string, database string) *mgo.Database
- func (o *ErrorHandler) NewRabbitMQWrapper(config RabbitMQConfig) *RabbitMQWrapper
- func (ctx *ErrorHandler) ParseInt(s string, base int, bitsize int) int64
- func (ctx *ErrorHandler) ParseUint(s string, base int, bitsize int) uint64
- func (o *ErrorHandler) RabbitMQChannel(conn *amqp.Connection) *amqp.Channel
- func (o *ErrorHandler) RabbitMQConnect(config RabbitMQConfig) *amqp.Connection
- func (o *ErrorHandler) Recover(name string)
- func (ctx *ErrorHandler) RestfulCall(req *httpx.RestfulRequest) *httpx.RestfulResponse
- func (ctx *ErrorHandler) ToJson(v interface{}) string
- func (o *ErrorHandler) ValidateJWTToken(secret string, bearerToken string) *AuthUser
- type ErrorMessage
- type FluentConfig
- type JSONTime
- type MessageType
- type MongoConfig
- type OssConfig
- type Paging
- type RabbitMQConfig
- type RabbitMQWrapper
- func (w *RabbitMQWrapper) Consume(queue string, consumer string, autoack bool, exclusive bool, nolocal bool, ...) (<-chan amqp.Delivery, error)
- func (w *RabbitMQWrapper) DeclareQueue(queue string, durable bool, autodelete bool, exclusive bool, nowait bool) error
- func (w *RabbitMQWrapper) Reconnect() error
- func (w *RabbitMQWrapper) Send(queue string, body string) error
- type RedisConfig
Constants ¶
View Source
const ( ACCESS_FROM_USER = 0 COLON = ":" )
View Source
const ( MessageTypeImage = iota MessageTypeEmoji )
View Source
const ( CH_BotNotify string = "botNotify" CH_ContactInfo string = "contactInfo" CH_GetContact string = "getContact" CONSU_WEB_BotNotify string = "webBotNotify" CONSU_WEB_ContactInfo string = "webContactInfo" CONSU_WEB_GetContact string = "webGetContact" )
View Source
const ( MT_ALIYUN string = "aliyun" MT_LOCAL string = "local" )
View Source
const ( //MongoDatabase string = "mo-chathub" WechatMessages string = "" )
Variables ¶
This section is empty.
Functions ¶
func AliyunGetPassword ¶
func AliyunGetUserName ¶
func GenSignedURLPair ¶
func GenSignedURLPair(ossBucket *oss.Bucket, messageType MessageType, imageId string, thumbImageId string) (string, string, error)
生成 image 和 thumbnailImage url,如果 thumbnailId 不存在,那么用 imageId + image process 方式生成 thumb
func NewAuthError ¶
func NewClientError ¶
func NewClientError(code ClientErrorCode, err error) error
func PasswordCheckSum ¶
func StringNull ¶
func StringNull(str string, defaultValue string) sql.NullString
Types ¶
type AuthChildUser ¶
type ClientError ¶
type ClientError struct { Code ClientErrorCode // contains filtered or unexported fields }
func (*ClientError) ErrorCode ¶
func (err *ClientError) ErrorCode() ClientErrorCode
type ClientErrorCode ¶
type ClientErrorCode int
const ( OK ClientErrorCode = 0 UNKNOWN ClientErrorCode = 1 IGNORED ClientErrorCode = 2 PARAM_REQUIRED ClientErrorCode = 1001 PARAM_INVALID ClientErrorCode = 1002 RESOURCE_INSUFFICIENT ClientErrorCode = 2001 RESOURCE_ACCESS_DENIED ClientErrorCode = 2002 RESOURCE_NOT_FOUND ClientErrorCode = 2003 RESOURCE_QUOTA_LIMIT ClientErrorCode = 2004 STATUS_INCONSISTENT ClientErrorCode = 3001 METHOD_UNSUPPORTED ClientErrorCode = 3002 )
type CommonResponse ¶
type CommonResponse struct { Code int `json:"code"` Message string `json:"message,omitempty"` Ts int64 `json:"ts"` Error ErrorMessage `json:"error,omitempty""` Body interface{} `json:"body,omitempty""` Paging Paging `json:"paging,omitempty"` }
type DatabaseConfig ¶
type ErrorHandler ¶
type ErrorHandler struct {
Err error
}
func (*ErrorHandler) BJTimeFromUnix ¶
func (ctx *ErrorHandler) BJTimeFromUnix(timestamp int64) time.Time
func (*ErrorHandler) FromJson ¶
func (ctx *ErrorHandler) FromJson(jsonstr string) map[string]interface{}
func (*ErrorHandler) FromMap ¶
func (ctx *ErrorHandler) FromMap(key string, m map[string]interface{}, objname string, defValue interface{}) interface{}
func (*ErrorHandler) FromMapFloat ¶
func (*ErrorHandler) FromMapInt ¶
func (*ErrorHandler) FromMapString ¶
func (*ErrorHandler) FromXML ¶
func (ctx *ErrorHandler) FromXML(xmlstr string, target interface{})
func (*ErrorHandler) GetResponseBody ¶
func (ctx *ErrorHandler) GetResponseBody(resp *httpx.RestfulResponse) map[string]interface{}
func (*ErrorHandler) ListValue ¶
func (o *ErrorHandler) ListValue(value interface{}, hasDefault bool, defValue []interface{}) []interface{}
func (*ErrorHandler) NewMongoConn ¶
func (*ErrorHandler) NewRabbitMQWrapper ¶
func (o *ErrorHandler) NewRabbitMQWrapper(config RabbitMQConfig) *RabbitMQWrapper
func (*ErrorHandler) ParseInt ¶
func (ctx *ErrorHandler) ParseInt(s string, base int, bitsize int) int64
func (*ErrorHandler) ParseUint ¶
func (ctx *ErrorHandler) ParseUint(s string, base int, bitsize int) uint64
func (*ErrorHandler) RabbitMQChannel ¶
func (o *ErrorHandler) RabbitMQChannel(conn *amqp.Connection) *amqp.Channel
func (*ErrorHandler) RabbitMQConnect ¶
func (o *ErrorHandler) RabbitMQConnect(config RabbitMQConfig) *amqp.Connection
func (*ErrorHandler) Recover ¶
func (o *ErrorHandler) Recover(name string)
func (*ErrorHandler) RestfulCall ¶
func (ctx *ErrorHandler) RestfulCall(req *httpx.RestfulRequest) *httpx.RestfulResponse
func (*ErrorHandler) ToJson ¶
func (ctx *ErrorHandler) ToJson(v interface{}) string
func (*ErrorHandler) ValidateJWTToken ¶
func (o *ErrorHandler) ValidateJWTToken(secret string, bearerToken string) *AuthUser
type ErrorMessage ¶
type MessageType ¶
type MessageType int
type MongoConfig ¶
type RabbitMQConfig ¶
type RabbitMQWrapper ¶
type RabbitMQWrapper struct {
// contains filtered or unexported fields
}
func (*RabbitMQWrapper) DeclareQueue ¶
func (*RabbitMQWrapper) Reconnect ¶
func (w *RabbitMQWrapper) Reconnect() error
Click to show internal directories.
Click to hide internal directories.