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) DeleteData(data *models.Data) error
- func (m *Module) DeleteFile(file *models.File) 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) GetData(key string) (*models.Data, error)
- func (m *Module) GetFile(uuid string) (*models.File, error)
- func (m *Module) GetFileByName(name string) (*models.File, 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) ListData() ([]*models.Data, error)
- func (m *Module) ListFiles() ([]*models.File, error)
- func (m *Module) ListPages(opts *api.ListPageRequest) ([]*models.Page, error)
- func (m *Module) ListRoutes(opts *api.ListRouteRequest) ([]*models.Route, error)
- func (m *Module) ListUsers() ([]*models.User, error)
- func (m *Module) Update(bucket string, pb db.AddressableProto) error
- func (m *Module) UpdateData(data *models.Data) error
- func (m *Module) UpdateDataBatch(data []*models.Data) error
- func (m *Module) UpdateFile(file *models.File) 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 ¶
const DATA_BUCKET = "data"
const FILES_BUCKET = "files"
const PAGE_BUCKET = "pages"
const ROUTE_BUCKET = "routes"
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 ¶
BackupToFile writes the entire database to the file at path.
func (*Module) Debug ¶
Debug prints out all data in the database. Does not deserialize saved protos.
func (*Module) DeleteData ¶ added in v0.2.0
DeleteData deletes a data from the DB (but not any related pages).
func (*Module) DeleteFile ¶ added in v0.3.0
DeleteFile deletes a file from the DB (but not from the store).
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) GetFileByName ¶ added in v0.3.0
GetFileByName fetches a file from the DB by name
func (*Module) ListFiles ¶ added in v0.3.0
ListFiles returns all files recorded in the DB (unsorted)
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) Update ¶
func (m *Module) Update(bucket string, pb db.AddressableProto) error
Update is a generic way of updating AddressableProto data in the bolt database.
func (*Module) UpdateDataBatch ¶ added in v0.2.0
func (*Module) UpdateFile ¶ added in v0.3.0
UpdateFile updates (or creates if necessary) an existing file.
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.