# Functions
AddBucket adds a bucket to be created if it doesn't already exist.
Addon looks for an addon by its addon_reverse_dns as the key and returns the []byte as json representation of an addon.
AddonAll returns all registered addons as a [][]byte.
AddonExists checks if there is an existing addon stored.
Backup writes a snapshot of the system.db database to an HTTP response.
CacheControl sets the default cache policy on static asset responses.
Close exports the abillity to close our db file.
Config gets the value of a key in the configuration from the db.
ConfigAll gets the configuration from the db.
ConfigCache is a in-memory cache of the Configs for quicker lookups 'key' is the JSON tag associated with the config field.
Content retrives one item from the database.
ContentAll retrives all items from the database within the provided namespace.
ContentBySlug does a lookup in the content index to find the type and id of the requested content.
ContentMulti returns a set of content based on the the targets / identifiers provided in Ponzu target string format: Type:ID NOTE: All targets should be of the same type.
CurrentUser extracts the user from the request data and returns the current user from the db.
DeleteAddon removes an addon from the db by its key, the addon_reverse_dns.
DeleteContent removes an item from the database.
DeleteIndex removes the key and value from the namespace provided and will return an error if it fails.
DeleteUpload removes the value for an upload at its key id, based on the target provided i.e.
DeleteUser deletes a user from the db by email.
DropIndex removes the index and all key/value pairs in the namespace index.
Index gets the value from the namespace at the key provided.
Init creates a db connection, initializes db with required info, sets secrets.
InitSearchIndex initializes Search Index for search to be functional This was moved out of db.Init and put to main(), because addon checker was initializing db together with search indexing initialisation in time when there were no item.Types defined so search index was always empty when using addons.
InvalidateCache sets a new Etag for http responses.
IsValidID checks that an ID from a DB target is valid.
LoadCacheConfig loads the config into a cache to be accessed by ConfigCache().
NewEtag generates a new Etag for response caching.
PutConfig updates a single k/v in the config.
Query retrieves a set of content from the db based on options and returns the total number of content in the namespace and the content.
RecoveryKey gets a previously set recovery key to verify an email address submitted in order to recover/reset an account password.
SetAddon stores the values of an addon into the __addons bucket with a the `addon_reverse_dns` field used as the key.
SetConfig sets key:value pairs in the db for configuration settings.
SetContent inserts/replaces values in the database.
SetIndex sets a key/value pair within the namespace provided and will return an error if it fails.
SetRecoveryKey generates and saves a random secret key to verify an email address submitted in order to recover/reset an account password.
SetUpload stores information about files uploaded to the system.
SetUser sets key:value pairs in the db for user settings.
SortContent sorts all content of the type supplied as the namespace by time, in descending order, from most recent to least recent Should be called from a goroutine after SetContent is successful.
Store provides access to the underlying *bolt.DB store.
SystemInitComplete checks if there is at least 1 admin user in the db which would indicate that the system has been configured to the minimum required.
UpdateContent updates/merges values in the database.
UpdateUser sets key:value pairs in the db for existing user settings.
Upload returns the value for an upload by its target (__uploads:{id}).
UploadAll returns a [][]byte containing all upload data from the system.
UploadBySlug returns the value for an upload by its slug.
User gets the user by email from the db.
UserAll returns all users from the db.
# Constants
DefaultMaxAge provides a 2592000 second (30-day) cache max-age setting.
# Variables
ErrNoAddonExists indicates that there was not addon found in the db.
ErrNoUserExists is used for the db to report to admin user of non-existing user.
ErrUserExists is used for the db to report to admin user of existing user.
# Structs
QueryOptions holds options for a query.