history

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type History

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

History is a ring-buffer class for history (string) data.

func New

func New(size int) *History

func (*History) Add

func (hist *History) Add(s string)

Add method adds new string in history buffer.

func (*History) At

func (hist *History) At(n int) string

At method returns .histroty (string) data at index.

func (*History) Export

func (hist *History) Export(w io.Writer) error

Export method exports history data to writer.

func (*History) Import

func (hist *History) Import(r io.Reader) error

Import method imports history data from reader.

func (*History) Len

func (hist *History) Len() int

Len method returns count of buffering strings.

func (*History) Size

func (hist *History) Size() int

Size method returns size of history buffer.

type HistoryFile

type HistoryFile struct {
	*History
	// contains filtered or unexported fields
}

HistoryFile is a history file class.

func NewFile

func NewFile(size int, path string) *HistoryFile

NewFile function returns new HistoryFile instance.

func (*HistoryFile) Load

func (hf *HistoryFile) Load() error

Load method imports history data from file.

func (*HistoryFile) Save

func (hf *HistoryFile) Save() error

Save method exports history data to file.

Jump to

Keyboard shortcuts

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