buffer

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2019 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Overview

Package buffer provides a simple ring buffer for storing local data

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

type Buffer struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New(i int) *Buffer

New returns a new buffer of the given size

func (*Buffer) Get

func (b *Buffer) Get(n int) []interface{}

Get returns the last n entries

func (*Buffer) Put

func (b *Buffer) Put(v interface{})

func (*Buffer) Size

func (b *Buffer) Size() int

Jump to

Keyboard shortcuts

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