Documentation ¶
Index ¶
- Variables
- func Get2Json(url string, res interface{}) error
- func Get2String(url string) (string, error)
- func GetStackTrace() string
- func NewContextHook(levels ...logrus.Level) logrus.Hook
- func NewLogger() *logrus.Logger
- func Post2Json(url string, data url.Values, res interface{}) error
- func StringToUint8(str string) uint8
- func Uint8ToString(uint8s []uint8) string
- type AsyncPriorityQueue
- type AsyncQueue
- type AsyncSet
- type Item
- type MyFormatter
- type PriorityQueue
- type Queue
- type Set
Constants ¶
This section is empty.
Variables ¶
var LOG = NewLogger()
Functions ¶
func Get2String ¶
func GetStackTrace ¶
func GetStackTrace() string
func NewContextHook ¶
NewContextHook use to make an hook 根据上面的推断, 我们递归深度可以设置到5即可.
func StringToUint8 ¶
func Uint8ToString ¶
Types ¶
type AsyncPriorityQueue ¶
type AsyncPriorityQueue struct {
// contains filtered or unexported fields
}
func NewAsyncPriorityQueue ¶
func NewAsyncPriorityQueue() *AsyncPriorityQueue
func (*AsyncPriorityQueue) Pop ¶
func (this *AsyncPriorityQueue) Pop() interface{}
func (*AsyncPriorityQueue) Push ¶
func (this *AsyncPriorityQueue) Push(value interface{})
func (*AsyncPriorityQueue) PushWithPriority ¶
func (this *AsyncPriorityQueue) PushWithPriority(value interface{}, priority int64)
type AsyncQueue ¶
type AsyncQueue struct { *Queue // contains filtered or unexported fields }
A thread safe version of Queue.
func (*AsyncQueue) Front ¶
func (q *AsyncQueue) Front() *list.Element
Same as Front for Queue, except it is thread safe.
func (*AsyncQueue) IsEmpty ¶
func (q *AsyncQueue) IsEmpty() bool
Same as IsEmpty for Queue, except it is thread safe.
func (*AsyncQueue) Len ¶
func (q *AsyncQueue) Len() int
Same as Len for Queue, except it is thread safe.
func (*AsyncQueue) Next ¶
func (q *AsyncQueue) Next(e *list.Element) *list.Element
Same as Next for Queue, except it is thread safe.
func (*AsyncQueue) Pop ¶
func (q *AsyncQueue) Pop() interface{}
Same as Pop for Queue, except it is thread safe.
func (*AsyncQueue) Push ¶
func (q *AsyncQueue) Push(o interface{})
Same as Push for Queue, except it is thread safe.
type AsyncSet ¶
func NewAsyncSet ¶
func NewAsyncSet() *AsyncSet
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
An Item is something we manage in a priority queue.
type MyFormatter ¶
type MyFormatter struct { }
type PriorityQueue ¶
type PriorityQueue struct {
// contains filtered or unexported fields
}
func NewPriorityQueue ¶
func NewPriorityQueue() *PriorityQueue
func (*PriorityQueue) Pop ¶
func (this *PriorityQueue) Pop() interface{}
func (*PriorityQueue) Push ¶
func (this *PriorityQueue) Push(value interface{})
func (*PriorityQueue) PushWithPriority ¶
func (this *PriorityQueue) PushWithPriority(value interface{}, priority int64)
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue represents the FIFO queue.
func (*Queue) Front ¶
Returns the item at the front of the Queue or nil. The item is a *list.Element from the 'container/list' package.
func (*Queue) Next ¶
Returns the item after e or nil it is the last item or nil. The item is a *list.Element from the 'container/list' package. Even though it is possible to call e.Next() directly, don't. This behavior may not be supported moving forward.