Documentation ¶
Index ¶
- Constants
- func AddTask(spec string, fn TaskHandler, name ...string)
- func BHex2Num(str string, n int) (int64, error)
- func BindYAML(path string, bind interface{}) error
- func Caller(calldepth int, short bool) string
- func Codes(err error) codes.Code
- func Contain(key interface{}, val interface{}) bool
- func DeepCopy(src interface{}, out interface{}) error
- func ErrDetail(err error) string
- func ErrMsg(err error) string
- func ErrString(err error) string
- func FileExists(path string) bool
- func FloatVal(data string) (float64, bool)
- func FromXErr(err error) *status.Status
- func GBKToUTF8(data string) (string, error)
- func GUID() string
- func Get(ctx context.Context, apiurl string, data map[string]string, second int, ...) (string, error)
- func Has(key interface{}, val ...interface{}) bool
- func HashID(id string, m int64) int64
- func IntVal(data string) (int64, bool)
- func InternalErr(serr error, msg string, where ...bool) error
- func JSONMarshal(data interface{}) (string, error)
- func JSONToStr(dstr interface{}) string
- func MErr(serr error, code codes.Code, msg string, where ...bool) error
- func MergeUrl(uri string, param map[string]string) string
- func NumToBHex(num, n int64) (string, error)
- func ObjectIDCounter(w int) string
- func Post(ctx context.Context, apiurl string, data map[string]string, second int, ...) (string, error)
- func PostJSON(ctx context.Context, apiurl string, data map[string]interface{}, second int, ...) (string, error)
- func RandID(width int) string
- func StartTask()
- func StopTask()
- func SubStr(str string, begin, length int) (substr string)
- func ToJSON(dstr string, data interface{}) error
- func ToStr(dval interface{}) string
- func ToYAML(data interface{}) (string, error)
- func UTF8ToGBK(data string) (string, error)
- func UrlDecode(data string) map[string]string
- func UrlEncode(data map[string]string) string
- func WrapErr(ctx context.Context, err error) error
- func XErr(code codes.Code, msg string, where ...bool) error
- func XMLToJSON(str string, obj interface{}) error
- func YAMLToJSON(str string, obj interface{}) error
- type Broadcast
- type BroadcastItem
- type BroadcastManager
- type ES
- type FieldTag
- type ScoreTree
- type TaskHandler
Constants ¶
View Source
const ( //User-Agent USER_AGENT string = "ares/v1" )
Variables ¶
This section is empty.
Functions ¶
func AddTask ¶
func AddTask(spec string, fn TaskHandler, name ...string)
func Get ¶
func Get(ctx context.Context, apiurl string, data map[string]string, second int, retry int) (string, error)
Get Get
func JSONMarshal ¶
func ObjectIDCounter ¶
func Post ¶
func Post(ctx context.Context, apiurl string, data map[string]string, second int, retry int) (string, error)
Post Post urlencode
func PostJSON ¶
func PostJSON(ctx context.Context, apiurl string, data map[string]interface{}, second int, retry int) (string, error)
PostJSON Post json
func YAMLToJSON ¶
Types ¶
type BroadcastItem ¶
type BroadcastItem struct {
// contains filtered or unexported fields
}
func (*BroadcastItem) Close ¶
func (c *BroadcastItem) Close() error
func (*BroadcastItem) Push ¶
func (c *BroadcastItem) Push(data string) error
func (*BroadcastItem) Subscriber ¶
func (c *BroadcastItem) Subscriber() string
type BroadcastManager ¶
func NewBroadcastManager ¶
func NewBroadcastManager(cap int) *BroadcastManager
func (*BroadcastManager) Get ¶
func (c *BroadcastManager) Get() (Broadcast, error)
func (*BroadcastManager) Len ¶
func (c *BroadcastManager) Len() int
func (*BroadcastManager) Push ¶
func (c *BroadcastManager) Push(data string) error
type ES ¶
func StructToStringMap ¶
func StructToStringMap(data interface{}) ES
StructToStringMap struct => map[string]string
type TaskHandler ¶
type TaskHandler func() error
Click to show internal directories.
Click to hide internal directories.