Documentation ¶
Index ¶
- type DatabaseSettings
- func (*DatabaseSettings) Actions(c context.Context) ([]portal.Action, error)
- func (*DatabaseSettings) Fields(c context.Context) ([]portal.Field, error)
- func (*DatabaseSettings) Overview(c context.Context) (template.HTML, error)
- func (*DatabaseSettings) ReadSettings(c context.Context) (map[string]string, error)
- func (*DatabaseSettings) Title(c context.Context) (string, error)
- func (*DatabaseSettings) WriteSettings(c context.Context, values map[string]string, who, why string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatabaseSettings ¶
type DatabaseSettings struct { // Server is the address of the SQL server is hosted. Server string `json:"server"` // Username is the username to authenticate to the server with. Username string `json:"username"` // Password is the password to authenticate to the server with. Password string `json:"password"` // Database is the name of the SQL database to connect to. Database string `json:"database"` }
DatabaseSettings are app-level settings configuring how to connect to the SQL database.
func Get ¶
func Get(c context.Context) (*DatabaseSettings, error)
Get returns the current settings. This may hit an outdated cache.
func GetUncached ¶
func GetUncached(c context.Context) (*DatabaseSettings, error)
GetUncached returns the latest settings, bypassing the cache.
func New ¶
func New(c context.Context) *DatabaseSettings
New returns a new instance of DatabaseSettings.
func (*DatabaseSettings) ReadSettings ¶
ReadSettings returns settings for display.
func (*DatabaseSettings) Title ¶
func (*DatabaseSettings) Title(c context.Context) (string, error)
Title returns the title of this settings page.
func (*DatabaseSettings) WriteSettings ¶
func (*DatabaseSettings) WriteSettings(c context.Context, values map[string]string, who, why string) error
WriteSettings commits any changes to the settings.
Click to show internal directories.
Click to hide internal directories.