Documentation
¶
Index ¶
- func GenerateConfig() error
- func HandleConfig(isProd bool, cb func(*Project) error) http.HandlerFunc
- type Auth
- type AuthStub
- type Config
- type Crud
- type CrudStub
- type FileRule
- type FileStore
- type FuncRules
- type Functions
- type Modules
- type Project
- type Realtime
- type Rule
- type SSL
- type Static
- type StaticRoute
- type TableRule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateConfig ¶
func GenerateConfig() error
GenerateConfig started the interactive cli to generate config file
func HandleConfig ¶
func HandleConfig(isProd bool, cb func(*Project) error) http.HandlerFunc
HandleConfig returns the handler to load the config via a REST endpoint
Types ¶
type AuthStub ¶
type AuthStub struct {
Enabled bool `json:"enabled" yaml:"enabled"`
ID string `json:"id" yaml:"id"`
Secret string `json:"secret" yaml:"secret"`
}
AuthStub holds the config at a single sign in level
type Config ¶
type Config struct {
Projects map[string]*Project `json:"projects" yaml:"projects"` // The key here is the project id
}
Config holds the entire configuration
type CrudStub ¶
type CrudStub struct {
Conn string `json:"conn" yaml:"conn"`
Collections map[string]*TableRule `json:"collections" yaml:"collections"` // The key here is table name
IsPrimary bool `json:"isPrimary" yaml:"isPrimary"`
}
CrudStub holds the config at the database level
type FileRule ¶
type FileRule struct {
Prefix string `json:"prefix" yaml:"prefix"`
Rule map[string]*Rule `json:"rule" yaml:"rule"` // The key can be create, read, delete
}
FileRule is the authorization object at the file rule level
type FileStore ¶
type FileStore struct {
Enabled bool `json:"enabled" yaml:"enabled"`
StoreType string `json:"storeType" yaml:"storeType"`
Conn string `json:"conn" yaml:"conn"`
Rules map[string]*FileRule `json:"rules" yaml:"rules"`
}
FileStore holds the config for the file store module
type Functions ¶
type Functions struct {
Enabled bool `json:"enabled" yaml:"enabled"`
Broker utils.Broker `json:"broker" yaml:"broker"`
Conn string `json:"conn" yaml:"conn"`
Rules FuncRules `json:"rules" yaml:"rules"`
}
Functions holds the config for the functions module
type Modules ¶
type Modules struct {
Crud Crud `json:"crud" yaml:"crud"`
Auth Auth `json:"auth" yaml:"auth"`
Functions *Functions `json:"functions" yaml:"functions"`
Realtime *Realtime `json:"realtime" yaml:"realtime"`
FileStore *FileStore `json:"fileStore" yaml:"fileStore"`
Static *Static `json:"static" yaml:"static"`
}
Modules holds the config of all the modules of that environment
type Project ¶
type Project struct {
ID string `json:"id" yaml:"id"`
Secret string `json:"secret" yaml:"secret"`
Modules *Modules `json:"modules" yaml:"modules"`
SSL *SSL `json:"ssl" yaml:"ssl"`
}
Project holds the project level configuration
func LoadConfigFromFile ¶
LoadConfigFromFile loads the config from the provided file path
type Realtime ¶
type Realtime struct {
Enabled bool `json:"enabled" yaml:"enabled"`
Broker utils.Broker `json:"broker" yaml:"broker"`
Conn string `json:"conn" yaml:"conn"`
}
Realtime holds the config for the realtime module
type Rule ¶
type Rule struct {
Rule string `json:"rule" yaml:"rule"`
Eval string `json:"eval" yaml:"eval"`
Type string `json:"type" yaml:"type"`
F1 interface{} `json:"f1" yaml:"f1"`
F2 interface{} `json:"f2" yaml:"f2"`
Clauses []*Rule `json:"clauses" yaml:"clauses"`
DB string `json:"db" yaml:"db"`
Col string `json:"col" yaml:"col"`
Find map[string]interface{} `json:"find" yaml:"find"`
Service string `json:"service" yaml:"service"`
Func string `json:"func" yaml:"func"`
}
Rule is the authorisation object at the query level
type Static ¶
type Static struct {
Enabled bool `json:"enabled" yaml:"enabled"`
Routes []*StaticRoute `json:"routes" yaml:"routes"`
}
Static holds the config for the static files module