luci: Index | Files

package settings

import ""


Package Files


type DatabaseSettings Uses

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 Uses

func Get(c context.Context) (*DatabaseSettings, error)

Get returns the current settings. This may hit an outdated cache.

func GetUncached Uses

func GetUncached(c context.Context) (*DatabaseSettings, error)

GetUncached returns the latest settings, bypassing the cache.

func New Uses

func New(c context.Context) *DatabaseSettings

New returns a new instance of DatabaseSettings.

func (*DatabaseSettings) Actions Uses

func (*DatabaseSettings) Actions(c context.Context) ([]portal.Action, error)

Actions is additional list of actions to present on the page.

func (*DatabaseSettings) Fields Uses

func (*DatabaseSettings) Fields(c context.Context) ([]portal.Field, error)

Fields returns the form fields for configuring these settings.

func (*DatabaseSettings) Overview Uses

func (*DatabaseSettings) Overview(c context.Context) (template.HTML, error)

Overview returns an overview of these settings.

func (*DatabaseSettings) ReadSettings Uses

func (*DatabaseSettings) ReadSettings(c context.Context) (map[string]string, error)

ReadSettings returns settings for display.

func (*DatabaseSettings) Title Uses

func (*DatabaseSettings) Title(c context.Context) (string, error)

Title returns the title of this settings page.

func (*DatabaseSettings) WriteSettings Uses

func (*DatabaseSettings) WriteSettings(c context.Context, values map[string]string, who, why string) error

WriteSettings commits any changes to the settings.

Package settings imports 4 packages (graph) and is imported by 1 packages. Updated 2020-11-26. Refresh now. Tools for package owners.