config

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2018 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSSOOrigins added in v0.1.33

func GetSSOOrigins() []string

GetSSOOrigins returns configured SSO origins

func GetVersion added in v0.1.99

func GetVersion() (string, string)

func OnUpdate

func OnUpdate(fn func(map[string]Store))

OnUpdate registers handler for config update event

func Update

func Update(c map[string]Store)

Update stores new config

Types

type Action

type Action struct {
	ID                  string `json:"_id"`
	ConcurentCallsLimit int    `json:"concurentCallsLimit,omitempty"`
	Multi               bool   `json:"multi"`
	Type                string `json:"type,omitempty"`
}

Action is a small representation of action in config

type CommonSettings added in v0.1.99

type CommonSettings struct {
	Commit    string `json:"commit"`
	BuildTime string `json:"buildTime"`
}

ServerSettings used to hold several server settings

type HTTPHook

type HTTPHook struct {
	URI                 string `json:"uri"`
	Method              string `json:"method"`
	ConcurentCallsLimit int    `json:"concurentCallsLimit,omitempty"`
}

HTTPHook is a small representation of HttpHooks in config

type Hooks

type Hooks struct {
	WillCreate string           `json:"willCreate,omitempty"`
	DidCreate  string           `json:"didCreate,omitempty"`
	WillSave   string           `json:"willSave,omitempty"`
	DidSave    string           `json:"didSave,omitempty"`
	WillRemove string           `json:"willRemove,omitempty"`
	DidRemove  string           `json:"didRemove,omitempty"`
	DidRead    string           `json:"didRead,omitempty"`
	DidStart   string           `json:"didStart,omitempty"`
	Migration  []*MigrationTask `json:"migration,omitempty"`
}

Hooks holds JavaScript code of hooks

type MigrationTask added in v0.1.98

type MigrationTask struct {
	Version int    `json:"version"`
	Script  string `json:"script"`
}

MigrationTask describes scheme migration scripts

type ServerSettings added in v0.1.33

type ServerSettings struct {
	SSOOrigins []string `json:"ssoOrigins,omitempty"`
}

ServerSettings used to hold several server settings

type Store

type Store struct {
	Version        int                    `json:"version"` // Scheme version
	Store          string                 `json:"store"`   // just name of the store
	Type           string                 `json:"type"`
	Props          interface{}            `json:"props"` // just dummy for props needed when HTTPAPI enabled
	Actions        []Action               `json:"actions,omitempty"`
	StoreActions   []Action               `json:"storeActions,omitempty"`
	HTTPHooks      []HTTPHook             `json:"httpHooks,omitempty"`
	HTTPAPI        bool                   `json:"httpApi,omitempty"`
	StoreLifeCycle Hooks                  `json:"storeLifeCycle,omitempty"`
	Entries        map[string]interface{} `json:"entries,omitempty"`
}

Store is a small representation of store in config

Jump to

Keyboard shortcuts

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