bolt

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const PAGE_BUCKET = "pages"
View Source
const ROUTE_BUCKET = "routes"
View Source
const USER_BUCKET = "users"

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltConfig

type BoltConfig struct {
	Bolt struct {
		Path string `json:"path"`
	} `json:"bolt"`
}

type ErrNoKey

type ErrNoKey string

func (ErrNoKey) Error

func (e ErrNoKey) Error() string

type Module

type Module struct {
	Bolt         *bolt.DB
	Backend      *db.Module
	ConfigModule *config.Module
	Logger       *logger.Module
	// contains filtered or unexported fields
}

Module bolt provides methods for writing and retrieving data from a bolt database.

func (*Module) Backup

func (m *Module) Backup(w io.Writer) error

func (*Module) BackupToFile

func (m *Module) BackupToFile(path string) error

func (*Module) Debug

func (m *Module) Debug(w io.Writer) error

func (*Module) DeletePage

func (m *Module) DeletePage(page *models.Page) error

DeletePage deletes the page and (note!) also deletes related routes.

func (*Module) DeleteRoute

func (m *Module) DeleteRoute(route *models.Route) error

DeleteRoute deletes a route from the DB (but not any related pages).

func (*Module) Get

func (m *Module) Get(bucket, key string, pb proto.Message) error

func (*Module) GetPage

func (m *Module) GetPage(uuid string) (*models.Page, error)

GetPage returns a page from the database

func (*Module) GetRoute

func (m *Module) GetRoute(uuid string) (*models.Route, error)

GetRoute fetches a route from the DB by UUID

func (*Module) GetUser

func (m *Module) GetUser(uuid string) (*models.User, error)

func (*Module) GetUserByEmail

func (m *Module) GetUserByEmail(email string) (*models.User, error)

func (*Module) GetUserByToken

func (m *Module) GetUserByToken(token string) (*models.User, error)

func (*Module) Init

func (m *Module) Init(c *service.Config)

Init implements service.Init

func (*Module) ListPages

func (m *Module) ListPages(opts *api.ListPageRequest) ([]*models.Page, error)

ListPages lists all the pages stored in the DB (unsorted), without contents

func (*Module) ListRoutes

func (m *Module) ListRoutes() ([]*models.Route, error)

ListRoutes returns all routes stored in the DB (unsorted)

func (*Module) Update

func (m *Module) Update(bucket string, pb db.AddressableProto) error

func (*Module) UpdatePage

func (m *Module) UpdatePage(page *models.Page) error

UpdatePage updates (creating if necessary) a new page. New pages and new content blocks will be assigned UUIDs

func (*Module) UpdateRoute

func (m *Module) UpdateRoute(route *models.Route) error

UpdateRoute updates (or creates if necessary) an existing route. The route uuid is set if it is blank.

func (*Module) UpdateUser

func (m *Module) UpdateUser(user *models.User) error

Jump to

Keyboard shortcuts

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