topk - ActiveState ActiveGo 1.8
...

Package topk

import "github.com/beorn7/perks/topk"
Overview
Index

Overview ▾

type Element

type Element struct {
    Value string
    Count int
}

type Samples

type Samples []*Element

func (Samples) Len

func (sm Samples) Len() int

func (Samples) Less

func (sm Samples) Less(i, j int) bool

func (Samples) Swap

func (sm Samples) Swap(i, j int)

type Stream

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

func New

func New(k int) *Stream

func (*Stream) Insert

func (s *Stream) Insert(x string)

func (*Stream) Merge

func (s *Stream) Merge(sm Samples)

func (*Stream) Query

func (s *Stream) Query() Samples