Documentation
¶
Overview ¶
Package templates writes commented starter files for realms and databases into CONFIG_DIR (`backd template`).
Index ¶
- type File
- func CollectionPolicy(configDir, realm, database, collection string) ([]File, error)
- func Database(configDir, realm, database string, sample bool) ([]File, error)
- func EmailCapture(configDir, realm, database string) ([]File, error)
- func Function(configDir, realm, database, name string) ([]File, error)
- func Project(dir, realm string) ([]File, error)
- func Realm(configDir, realm string, sample bool) ([]File, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct {
Path string // relative to CONFIG_DIR, slash-separated
Created bool // false: it already existed and was left unchanged
}
File reports what happened to one file.
func CollectionPolicy ¶ added in v0.4.0
CollectionPolicy creates <realm>/<database>/<collection>/collection.yaml, a commented example of the collection's rules, soft delete, and what an erase can do to it (everything is commented out: without a policy an erase leaves the collection alone). The collection must exist.
func Database ¶
Database creates <realm>/<database>/ under configDir; the realm must already exist. With sample, it adds the blog sample collection.
func EmailCapture ¶ added in v0.4.0
EmailCapture adds the development delivery function email-capture to <realm>/<database>/_functions, and the collection outbox it writes to. The database must exist.
func Function ¶
Function creates the function <name> in <realm>/<database>/_functions, with the project's deno.json if it has none; the database must exist.
func Project ¶
Project creates a new, self-contained config repository at dir (which must not already exist): a realm with the sample database and collection, a sample function with tests, the Dockerfiles and compose stack (MongoDB, backd, the executor and egress) for local development, and the CI workflow from the docs' "Deploying config" guide — so "develop locally → CI → promote a tag" works from the first commit.