Documentation ¶
Index ¶
- Constants
- type BoltConfig
- type ErrNoKey
- type Module
- func (m *Module) Backup(w io.Writer) error
- func (m *Module) BackupToFile(path string) error
- func (m *Module) Debug(w io.Writer) error
- func (m *Module) DeletePage(page *models.Page) error
- func (m *Module) DeleteRoute(route *models.Route) error
- func (m *Module) Get(bucket, key string, pb proto.Message) error
- func (m *Module) GetPage(uuid string) (*models.Page, error)
- func (m *Module) GetRoute(uuid string) (*models.Route, error)
- func (m *Module) GetUser(uuid string) (*models.User, error)
- func (m *Module) GetUserByEmail(email string) (*models.User, error)
- func (m *Module) GetUserByToken(token string) (*models.User, error)
- func (m *Module) Init(c *service.Config)
- func (m *Module) ListPages(opts *api.ListPageRequest) ([]*models.Page, error)
- func (m *Module) ListRoutes() ([]*models.Route, error)
- func (m *Module) Update(bucket string, pb db.AddressableProto) error
- func (m *Module) UpdatePage(page *models.Page) error
- func (m *Module) UpdateRoute(route *models.Route) error
- func (m *Module) UpdateUser(user *models.User) error
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 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) BackupToFile ¶
func (*Module) DeletePage ¶
DeletePage deletes the page and (note!) also deletes related routes.
func (*Module) DeleteRoute ¶
DeleteRoute deletes a route from the DB (but not any related pages).
func (*Module) ListPages ¶
ListPages lists all the pages stored in the DB (unsorted), without contents
func (*Module) ListRoutes ¶
ListRoutes returns all routes stored in the DB (unsorted)
func (*Module) UpdatePage ¶
UpdatePage updates (creating if necessary) a new page. New pages and new content blocks will be assigned UUIDs
func (*Module) UpdateRoute ¶
UpdateRoute updates (or creates if necessary) an existing route. The route uuid is set if it is blank.
Click to show internal directories.
Click to hide internal directories.