fileVarint

package module
v0.0.0-...-f94b3ec Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	sync.Mutex

	FileName string
	// contains filtered or unexported fields
}

File is a non-thread safe queue type of fifo based on bytes array. For every push operation index of entry is returned. It can be used to read the entry later

func New

func New() (f *File)

func (*File) Close

func (q *File) Close()

func (*File) Len

func (q *File) Len() int

Len returns number of entries kept in queue

func (*File) Open

func (q *File) Open(fileName string) (err error)

func (*File) Read

func (q *File) Read(index int) ([]byte, error)

Get reads entry from index

func (*File) Remove

func (q *File) Remove()

func (*File) Write

func (q *File) Write(data []byte) (index int, err error)

Returns index for pushed data or error if maximum size queue limit is reached.

Jump to

Keyboard shortcuts

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