datastore

package
v0.0.0-...-873507f Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2019 License: GPL-2.0, GPL-2.0-only Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datastore

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

Datastore is where user accounts and page metadata is stored

func New

func New(path string) (*Datastore, error)

New returns a new, already opened Datastore instance at <path>

func (*Datastore) Close

func (d *Datastore) Close()

Close closes the enclosed bolt database

func (*Datastore) CountUsers

func (d *Datastore) CountUsers() (int, error)

CountUsers returns the number of users in the datastore

func (*Datastore) CreateUser

func (d *Datastore) CreateUser(u *user.User) error

CreateUser creates a new user in the database

func (*Datastore) DeletePage

func (d *Datastore) DeletePage(id string) error

DeletePage deletes a page from the datastore.

func (*Datastore) DeleteUser

func (d *Datastore) DeleteUser(id string) error

DeleteUser deletes a user from the datastore.

func (*Datastore) GetPage

func (d *Datastore) GetPage(id string) (*page.Page, error)

GetPage returns a page from the datastore

func (*Datastore) GetUser

func (d *Datastore) GetUser(id string) (*user.User, error)

GetUser returns a page from the datastore

func (*Datastore) RenamePage

func (d *Datastore) RenamePage(oldID string, newID string) error

RenamePage will delete the old page and insert the new one

func (*Datastore) UpdatePage

func (d *Datastore) UpdatePage(p *page.Page, pageID string) error

UpdatePage updates a page in the datastore

func (*Datastore) UpdateUser

func (d *Datastore) UpdateUser(u *user.User) error

UpdateUser updates a user in the datastore

func (*Datastore) UserExists

func (d *Datastore) UserExists(id string) (bool, error)

UserExists returns a false if the user doesn't exist in the datastore

Jump to

Keyboard shortcuts

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