data

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Record

type Record struct {
	Group, Title, Password, Describe string
	Ct                               time.Time
}

func FromCsvRecord

func FromCsvRecord(r []string) (*Record, error)

func (*Record) Equal

func (p *Record) Equal(r *Record) bool

func (*Record) ToCsvRecord

func (p *Record) ToCsvRecord() []string

type Records

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

func (*Records) ByGroup

func (p *Records) ByGroup(group string) *Records

func (*Records) ByTitle

func (p *Records) ByTitle(title string) *Records

func (*Records) DeleteGroup

func (p *Records) DeleteGroup(group string)

func (*Records) DeleteTitle

func (p *Records) DeleteTitle(title string)

func (*Records) GetRecords added in v1.3.0

func (p *Records) GetRecords() []*Record

func (*Records) GroupLike

func (p *Records) GroupLike(groupLike string) *Records

func (*Records) Groups

func (p *Records) Groups() []string

func (*Records) Latest

func (p *Records) Latest() *Record

func (*Records) Len

func (p *Records) Len() int

func (*Records) Less

func (p *Records) Less(i, j int) bool

func (*Records) Put

func (p *Records) Put(record *Record)

func (*Records) Sort

func (p *Records) Sort()

func (*Records) Swap

func (p *Records) Swap(i, j int)

func (*Records) TitleLike

func (p *Records) TitleLike(titleLike string) *Records

func (*Records) Titles

func (p *Records) Titles() []string

type Store

type Store interface {
	GetRecords() []*Record
	Save() (string, error)
	ListGroups() ([]string, error)
	ListTitles() ([]string, error)
	ListAll() ([]*Record, error)
	Filter(groupLike, titleLike string) ([]*Record, error)
	Put(group, title, password, describe string) (*Record, error)
	Get(title string) (*Record, error)
	GetHistory(title string) ([]*Record, error)
	DeleteTitle(title string) error
	DeleteGroup(group string) error
}

func New

func New(content string) (Store, error)

Jump to

Keyboard shortcuts

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