godock: github.com/sqp/godock/libs/files/history Index | Files

package history

import "github.com/sqp/godock/libs/files/history"

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


Package Files


type AppletLike Uses

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

AppletLike defines a small applet like interface.

type History Uses

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 Uses

func New(app AppletLike, filename string) *History

New creates a new history manager to save applets data.

func (*History) Load Uses

func (h *History) Load() error

Load loads the history data.

func (*History) Save Uses

func (h *History) Save() error

Save saves the history data.

func (*History) SetFuncs Uses

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

SetFuncs sets callback funcs.

func (*History) SetHistoryFile Uses

func (h *History) SetHistoryFile(file string)

SetHistoryFile sets the location of the history file.

func (*History) SetHistorySize Uses

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.

Package history imports 3 packages (graph) and is imported by 1 packages. Updated 2016-08-21. Refresh now. Tools for package owners.