community: github.com/documize/community/domain/setting Index | Files

package setting

import "github.com/documize/community/domain/setting"

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

Package Files

endpoint.go model.go smtp.go store.go

func GetSMTPConfig Uses

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

GetSMTPConfig returns SMTP configuration.

type Handler Uses

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

Handler contains the runtime information such as logging and database.

func (*Handler) AuthConfig Uses

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

AuthConfig returns installation-wide auth configuration

func (*Handler) GetGlobalSetting Uses

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

GetGlobalSetting returns the requested organization level setting.

func (*Handler) GetInstanceSetting Uses

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

GetInstanceSetting returns the requested organization level setting.

func (*Handler) SMTP Uses

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

SMTP returns installation-wide SMTP settings

func (*Handler) SaveGlobalSetting Uses

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

SaveGlobalSetting saves org level setting.

func (*Handler) SaveInstanceSetting Uses

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

SaveInstanceSetting saves org level setting.

func (*Handler) SetAuthConfig Uses

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

SetAuthConfig persists installation-wide authentication configuration

func (*Handler) SetSMTP Uses

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

SetSMTP persists global SMTP configuration.

type Store Uses

type Store struct {
    store.Context
    store.SettingStorer
}

Store provides data access to user permission information.

func (Store) Get Uses

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

Get fetches a configuration JSON element from the config table.

func (Store) GetUser Uses

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 Uses

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

Set writes a configuration JSON element to the config table.

func (Store) SetUser Uses

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.

Package setting imports 16 packages (graph) and is imported by 4 packages. Updated 2019-11-14. Refresh now. Tools for package owners.