storage

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RelativeTimeDisplay

func RelativeTimeDisplay(ts int) string

Types

type HostBackend

type HostBackend interface {
	CreateProfile(hostname string) (*HostProfile, error)
	GetProfile(hostname string) (*HostProfile, error)
	AddNewVisit(hostname string) error
	DeleteHost(hostname string) error
}

HostBackend defines the interface for hostEntry actions

type HostBackendStorm

type HostBackendStorm struct {
	Database *storm.DB
}

func NewHostBackend

func NewHostBackend(path string) (*HostBackendStorm, error)

func (*HostBackendStorm) AddNewVisit

func (backend *HostBackendStorm) AddNewVisit(hostname string) error

func (*HostBackendStorm) CreateProfile

func (backend *HostBackendStorm) CreateProfile(hostname string) (*HostProfile, error)

func (*HostBackendStorm) DeleteHost

func (backend *HostBackendStorm) DeleteHost(hostname string) error

func (*HostBackendStorm) GetProfile

func (backend *HostBackendStorm) GetProfile(hostname string) (*HostProfile, error)

type HostProfile

type HostProfile struct {
	ID          int    `storm:"id,increment"`
	Name        string `storm:"unique"`
	Visited     int
	LastVisited int
}

func (*HostProfile) GetLastVisitedForDisplay

func (p *HostProfile) GetLastVisitedForDisplay() string

Jump to

Keyboard shortcuts

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