Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TopList ¶
type TopList struct {
// contains filtered or unexported fields
}
TopList store some elements in list with specified capacity, the oldest elements that exceed specified capacity will be discarded
func New ¶
New create a TopList with specified capacity and the capacity must be greater than zero, order by add time desc
func NewOrderByAsc ¶
NewOrderByAsc create a TopList with specified capacity and the capacity must be greater than zero, order by add time asc
func (*TopList) Get ¶
Get get an element by a specified index in the list, if the index is greater than TopList.Len or less than 0, return a nil element always
func (*TopList) MarshalJSON ¶
MarshalJSON implement interface json.Marshaler
Click to show internal directories.
Click to hide internal directories.