equeue

package
v1.5.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2019 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultErrorsListCap = 100
	PipeLineError        = "ErrorMessage="
)

Variables

This section is empty.

Functions

func EqualErrors

func EqualErrors(old, new string) bool

Types

type ErrorInfo

type ErrorInfo struct {
	Error     string `json:"error"`
	Timestamp int64  `json:"timestamp"`
	Count     int64  `json:"count"`
}

func NewError

func NewError(msg string) ErrorInfo

type ErrorQueue

type ErrorQueue struct {
	// contains filtered or unexported fields
}

保证内部成员的数值只能由方法调用而改变,不能直接修改

func New

func New(capacity int) *ErrorQueue

func (*ErrorQueue) Append

func (q *ErrorQueue) Append(errors []ErrorInfo)

向队列中添加元素

func (*ErrorQueue) Clone

func (q *ErrorQueue) Clone() *ErrorQueue

将另一个queue复制到当前queue中

func (*ErrorQueue) Empty

func (q *ErrorQueue) Empty() bool

func (*ErrorQueue) End

func (q *ErrorQueue) End() ErrorInfo

获取队列中最后一个元素

func (*ErrorQueue) EqualLast

func (q *ErrorQueue) EqualLast(e ErrorInfo) bool

比较是否和最后的error类型相等,方便增加计数而不是直接插入元素

func (*ErrorQueue) Front

func (q *ErrorQueue) Front() ErrorInfo

获取队列中第一个元素

func (*ErrorQueue) GetMaxSize

func (q *ErrorQueue) GetMaxSize() int

返回队列实际容量

func (*ErrorQueue) GetN

func (q *ErrorQueue) GetN(n int) ErrorInfo

获取队列中第N个元素

func (*ErrorQueue) List

func (q *ErrorQueue) List() []ErrorInfo

按进出顺序复制到数组中

func (*ErrorQueue) Put

func (q *ErrorQueue) Put(e ErrorInfo)

向队列中添加单个元素

func (*ErrorQueue) Size

func (q *ErrorQueue) Size() int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL