setting

package
v1.76.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2018 License: AGPL-3.0 Imports: 16 Imported by: 11

Documentation

Overview

Package setting manages both global and user level settings

Package setting manages both global and user level settings

Package setting manages both global and user level settings

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSMTPConfig added in v1.58.0

func GetSMTPConfig(s *store.Store) (c smtp.Config)

GetSMTPConfig returns SMTP configuration.

Types

type Handler

type Handler struct {
	Runtime *env.Runtime
	Store   *store.Store
}

Handler contains the runtime information such as logging and database.

func (*Handler) AuthConfig

func (h *Handler) AuthConfig(w http.ResponseWriter, r *http.Request)

AuthConfig returns installation-wide auth configuration

func (*Handler) GetGlobalSetting added in v1.71.0

func (h *Handler) GetGlobalSetting(w http.ResponseWriter, r *http.Request)

GetGlobalSetting returns the requested organization level setting.

func (*Handler) GetInstanceSetting added in v1.71.0

func (h *Handler) GetInstanceSetting(w http.ResponseWriter, r *http.Request)

GetInstanceSetting returns the requested organization level setting.

func (*Handler) SMTP

func (h *Handler) SMTP(w http.ResponseWriter, r *http.Request)

SMTP returns installation-wide SMTP settings

func (*Handler) SaveGlobalSetting added in v1.71.0

func (h *Handler) SaveGlobalSetting(w http.ResponseWriter, r *http.Request)

SaveGlobalSetting saves org level setting.

func (*Handler) SaveInstanceSetting added in v1.71.0

func (h *Handler) SaveInstanceSetting(w http.ResponseWriter, r *http.Request)

SaveInstanceSetting saves org level setting.

func (*Handler) SetAuthConfig

func (h *Handler) SetAuthConfig(w http.ResponseWriter, r *http.Request)

SetAuthConfig persists installation-wide authentication configuration

func (*Handler) SetSMTP

func (h *Handler) SetSMTP(w http.ResponseWriter, r *http.Request)

SetSMTP persists global SMTP configuration.

type Store added in v1.71.0

type Store struct {
	store.Context
	store.SettingStorer
}

Store provides data access to user permission information.

func (Store) Get added in v1.71.0

func (s Store) Get(area, path string) (value string, err error)

Get fetches a configuration JSON element from the config table.

func (Store) GetUser added in v1.71.0

func (s Store) GetUser(orgID, userID, key, path string) (value string, err error)

GetUser fetches a configuration JSON element from the userconfig table for a given orgid/userid combination. Errors return the empty string. A blank path returns the whole JSON object, as JSON. You can store org level settings by providing an empty user ID.

func (Store) Set added in v1.71.0

func (s Store) Set(area, json string) (err error)

Set writes a configuration JSON element to the config table.

func (Store) SetUser added in v1.71.0

func (s Store) SetUser(orgID, userID, key, json string) (err error)

SetUser writes a configuration JSON element to the userconfig table for the specified user. You can store org level settings by providing an empty user ID.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL