db

package
v0.0.0-...-75d66c5 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2017 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package db provides disk persistence functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentSession

func CurrentSession() (*session.Session, error)

func DoHousekeeping

func DoHousekeeping()

erase old database records works based on configuration variables:

db.maxSessions
db.maxReports

func EraseSession

func EraseSession(uuid string) error

erase session from db - also updates index by removing relevant session metadata

func NthSession

func NthSession(n int) (*session.Session, error)

func PreviousSession

func PreviousSession() (*session.Session, error)

func ReadSession

func ReadSession(uuid string) (*session.Session, error)

get session from db by uuid

func WriteSession

func WriteSession(sess *session.Session) error

save session to db - also updates index with session metadata

Types

type Index

type Index struct {
	Sessions SessionIndex `json:"sessions"`
}

database index

type SessionIndex

type SessionIndex []session.SessionMeta

index containing session metadata

func (SessionIndex) Len

func (p SessionIndex) Len() int

helper for sort.Sort

func (SessionIndex) Less

func (p SessionIndex) Less(i, j int) bool

helper for sort.Sort

func (SessionIndex) Swap

func (p SessionIndex) Swap(i, j int)

helper for sort.Sort

Jump to

Keyboard shortcuts

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