history

package
v0.0.0-...-0caaa62 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2017 License: GPL-3.0-or-later Imports: 3 Imported by: 0

Documentation

Overview

Package history provides the core part for services history data management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppletLike

type AppletLike interface {
	FileDataDir(...string) string
}

AppletLike defines a small applet like interface.

type History

type History struct {
	File string // Path to history file.
	Max  int    // max number of items in history.
	// contains filtered or unexported fields
}

History defines the core part for services history data management.

func New

func New(app AppletLike, filename string) *History

New creates a new history manager to save applets data.

func (*History) Load

func (h *History) Load() error

Load loads the history data.

func (*History) Save

func (h *History) Save() error

Save saves the history data.

func (*History) SetFuncs

func (h *History) SetFuncs(load, save func() error, trim func())

SetFuncs sets callback funcs.

func (*History) SetHistoryFile

func (h *History) SetHistoryFile(file string)

SetHistoryFile sets the location of the history file.

func (*History) SetHistorySize

func (h *History) SetHistorySize(nb int)

SetHistorySize sets the size of the history. It will trim history size if needed.

 -1  : unlimited
  0  : disabled
>=1  : limit set.

Jump to

Keyboard shortcuts

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