db

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 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 ExoDB

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

func (*ExoDB) AddRow

func (e *ExoDB) AddRow(tagID int64, text string, parentRowID int64) (Row, error)

func (*ExoDB) AddTag

func (e *ExoDB) AddTag(name string) (Tag, error)

func (*ExoDB) Close

func (e *ExoDB) Close()

func (*ExoDB) DeleteRowByID

func (e *ExoDB) DeleteRowByID(id int64) error

func (*ExoDB) DeleteTagByID

func (e *ExoDB) DeleteTagByID(id int64) error

func (*ExoDB) GetAllTags

func (e *ExoDB) GetAllTags() ([]Tag, error)

func (*ExoDB) GetRefsToTagByTagID

func (e *ExoDB) GetRefsToTagByTagID(tagID int64) (Refs, error)

func (*ExoDB) GetRefsToTagByTagName

func (e *ExoDB) GetRefsToTagByTagName(name string) (Refs, error)

func (*ExoDB) GetRowByID

func (e *ExoDB) GetRowByID(id int64) (Row, error)

func (*ExoDB) GetRowsForTagID

func (e *ExoDB) GetRowsForTagID(tagID int64) ([]Row, error)

func (*ExoDB) GetTagByID

func (e *ExoDB) GetTagByID(id int64) (Tag, error)

func (*ExoDB) GetTagByName

func (e *ExoDB) GetTagByName(name string) (Tag, error)

func (*ExoDB) LoadSchema

func (e *ExoDB) LoadSchema() error

func (*ExoDB) Open

func (e *ExoDB) Open(filename string) error

func (*ExoDB) RenameTag

func (e *ExoDB) RenameTag(oldname string, newname string) (Tag, error)

func (*ExoDB) UpdateRowRank added in v0.4.1

func (e *ExoDB) UpdateRowRank(rowID int64, rank int) error

func (*ExoDB) UpdateRowText

func (e *ExoDB) UpdateRowText(rowID int64, text string) error

type Refs

type Refs map[Tag][]Row

Refs represents all refs to a given tag, where the key is the tag the row(s) came from

type Row

type Row struct {
	ID          int64
	TagID       int64
	Rank        int
	Text        string
	ParentRowID int64
	UpdatedTS   int64
}

type State added in v0.4.1

type State struct {
	DB                *ExoDB
	AllDBTags         []Tag
	CurrentDBTag      Tag
	CurrentDBRows     []Row
	CurrentDBRefs     Refs
	SortedRefTagsKeys []Tag
}

func (*State) DeleteTagIfEmpty added in v0.4.1

func (s *State) DeleteTagIfEmpty(id int64) error

func (*State) Refresh added in v0.4.1

func (s *State) Refresh() error

type Tag

type Tag struct {
	ID        int64
	Name      string
	UpdatedTS int64
}

Jump to

Keyboard shortcuts

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