Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OptionInitDB ¶
OptionInitDB will initialize the database during the API instance creation, dropping all existing tables, which will force all migration scripts to be re-executed. Use with caution, this will DESTROY ALL YOUR DATA.
func OptionInstanceMode ¶
func OptionInstanceMode(mode config.InstanceMode) func(*API) error
OptionInstanceMode records the node role this process was started with, which selects the serving database role. Without it a node provisions the way a single instance does.
func SetDBPasswordProvider ¶
func SetDBPasswordProvider(provider DBPasswordProvider)
SetDBPasswordProvider installs the provider New authenticates with. Call it before New.
Types ¶
type API ¶
API represents an api instance used to interact with Nebraska entities.
func NewForTest ¶
NewForTest creates a new API instance with given options and fills the database with sample data for testing purposes.
func NewWithMigrations ¶
NewWithMigrations creates a new API instance, creates the underlying db connection and applies all available db migrations.
type DBPasswordProvider ¶
DBPasswordProvider supplies the password used to authenticate a database connection. Nebraska calls it before opening every physical connection, so an implementation is free to return a credential that expires, such as an OAuth token, without Nebraska having to know how it is obtained.
The user the connection is being made as is passed so that a single provider can serve connections that authenticate as different roles.
If connect_timeout is set in NEBRASKA_DB_URL, the context carries it as its deadline, and an implementation is expected to honour it.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package admin provides write operations for admin-managed tables (application, channel, package, groups, team, users).
|
Package admin provides write operations for admin-managed tables (application, channel, package, groups, team, users). |
|
internal
|
|
|
dbconn
Package dbconn owns the database connection shared by the api stack.
|
Package dbconn owns the database connection shared by the api stack. |
|
dbreads
Package dbreads holds the shared read queries used by the api stack.
|
Package dbreads holds the shared read queries used by the api stack. |
|
Package runtime provides operations for runtime-managed tables (instance, instance_application, instance_status_history, event, activity, group_local, instance_stats).
|
Package runtime provides operations for runtime-managed tables (instance, instance_application, instance_status_history, event, activity, group_local, instance_stats). |
|
Package types holds the domain model shared across the backend: the entities Nebraska persists, the status and event constants describing them, and the sentinel errors returned by operations on them.
|
Package types holds the domain model shared across the backend: the entities Nebraska persists, the status and event constants describing them, and the sentinel errors returned by operations on them. |