Documentation
¶
Index ¶
- func GenerateConfig(configFilePath string) error
- func StoreConfigToFile(conf *Config, path string) error
- type Admin
- type AdminUser
- type Auth
- type AuthStub
- type Config
- type Crud
- type CrudStub
- type Endpoint
- type Eventing
- type EventingRule
- type FileRule
- type FileStore
- type Modules
- type OperationConfig
- type Project
- type ProjectScope
- type Rule
- type SSL
- type Service
- type Services
- type ServicesModule
- type Static
- type StaticRoute
- type TableRule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateConfig ¶
GenerateConfig started the interactive cli to generate config file
func StoreConfigToFile ¶ added in v0.10.0
StoreConfigToFile stores the config file to disk
Types ¶
type Admin ¶ added in v0.10.0
type Admin struct {
Secret string `json:"secret" yaml:"secret"`
Operation OperationConfig `json:"operation"`
Users []AdminUser `json:"users" yaml:"users"`
}
Admin stores the admin credentials
type AdminUser ¶ added in v0.10.0
type AdminUser struct {
User string `json:"user" yaml:"user"`
Pass string `json:"pass" yaml:"pass"`
Scopes ProjectScope `json:"scopes" yaml:"scopes"`
}
AdminUser holds the user credentials and scope
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 []*Project `json:"projects" yaml:"projects"` // The key here is the project id
SSL *SSL `json:"ssl" yaml:"ssl"`
Admin *Admin `json:"admin" yaml:"admin"`
}
Config holds the entire configuration
func GenerateEmptyConfig ¶ added in v0.10.0
func GenerateEmptyConfig() *Config
GenerateEmptyConfig creates an empty config file
func LoadConfigFromFile ¶
LoadConfigFromFile loads the config from the provided file path
type CrudStub ¶
type CrudStub struct {
Type string `json:"type" yaml:"type"` // database type
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"`
Enabled bool `json:"enabled" yaml:"enabled"`
}
CrudStub holds the config at the database level
type Endpoint ¶ added in v0.13.0
type Endpoint struct {
Method string `json:"method" yaml:"method"`
Path string `json:"path" yaml:"path"`
Rule *Rule `json:"rule" yaml:"rule"`
}
Endpoint holds the config of a endpoint
type Eventing ¶ added in v0.12.0
type Eventing struct {
Enabled bool `json:"enabled" yaml:"enabled"`
DBType string `json:"dbType" yaml:"dbType"`
Col string `json:"col" yaml:"col"`
Rules map[string]EventingRule `json:"rules" yaml:"rules"`
InternalRules map[string]EventingRule `json:"internalRules,omitempty" yaml:"internalRules,omitempty"`
}
Eventing holds the config for the eventing module (task queue)
type EventingRule ¶ added in v0.12.0
type EventingRule struct {
Type string `json:"type" yaml:"type"`
Retries int `json:"retries" yaml:"retries"`
Url string `json:"url" yaml:"url"`
Options map[string]string `json:"options" yaml:"options"`
}
EventingRule holds an eventing rule
type FileRule ¶
type FileRule struct {
Name string `json:"name" yaml:"name"`
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"`
Endpoint string `json:"endpoint" yaml:"endpoint"`
Bucket string `json:"bucket" yaml:"bucket"`
Rules []*FileRule `json:"rules" yaml:"rules"`
}
FileStore holds the config for the file store module
type Modules ¶
type Modules struct {
Crud Crud `json:"crud" yaml:"crud"`
Auth Auth `json:"auth" yaml:"auth"`
Services *ServicesModule `json:"services" yaml:"services"`
FileStore *FileStore `json:"fileStore" yaml:"fileStore"`
Eventing Eventing `json:"eventing,omitempty" yaml:"eventing,omitempty"`
}
Modules holds the config of all the modules of that environment
type OperationConfig ¶ added in v0.10.0
type OperationConfig struct {
Mode int `json:"mode" yaml:"mode"`
UserID string `json:"userId" yaml:"userId"`
Key string `json:"key" yaml:"key"`
}
OperationConfig holds the operation mode config
type Project ¶
type Project struct {
Secret string `json:"secret" yaml:"secret"`
ID string `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
Modules *Modules `json:"modules" yaml:"modules"`
}
Project holds the project level configuration
type ProjectScope ¶ added in v0.10.0
ProjectScope contains the project level scope
type Rule ¶
type Rule struct {
Rule string `json:"rule" yaml:"rule"`
Eval string `json:"eval,omitempty" yaml:"eval,omitempty"`
Type string `json:"type,omitempty" yaml:"type,omitempty"`
F1 interface{} `json:"f1,omitempty" yaml:"f1,omitempty"`
F2 interface{} `json:"f2,omitempty" yaml:"f2,omitempty"`
Clauses []*Rule `json:"clauses,omitempty" yaml:"clauses,omitempty"`
DB string `json:"db,omitempty" yaml:"db,omitempty"`
Col string `json:"col,omitempty" yaml:"col,omitempty"`
Find map[string]interface{} `json:"find,omitempty" yaml:"find,omitempty"`
Url string `json:"url,omitempty" yaml:"url,omitempty"`
Fields []string `json:"fields,omitempty" yaml:"fields,omitempty`
Field string `json:"field,omitempty" yaml:"field,omitempty`
Value interface{} `json:"value,omitempty" yaml:"value,omitempty`
}
Rule is the authorisation object at the query level
type SSL ¶
type SSL struct {
Enabled bool `json:"enabled" yaml:"enabled"`
Crt string `json:"crt" yaml:"crt"`
Key string `json:"key" yaml:"key"`
}
SSL holds the certificate and key file locations
type Service ¶ added in v0.11.0
type Service struct {
URL string `json:"url,omitempty" yaml:"url,omitempty"` // eg. http://localhost:8080
Endpoints map[string]Endpoint `json:"endpoints" yaml:"endpoints"`
}
Service holds the config of service
type ServicesModule ¶ added in v0.13.0
type ServicesModule struct {
Services Services `json:"externalServices" yaml:"externalServices"`
InternalServices Services `json:"internalServices" yaml:"internalServices"`
}
ServicesModule holds the config for the service module
type Static ¶
type Static struct {
Routes []*StaticRoute `json:"routes" yaml:"routes"`
InternalRoutes []*StaticRoute `json:"internalRoutes" yaml:"internalRoutes"`
}
Static holds the config for the static files module
type StaticRoute ¶
type StaticRoute struct {
ID string `json:"id,omitempty" yaml:"id,omitempty"`
Path string `json:"path" yaml:"path"`
URLPrefix string `json:"prefix" yaml:"prefix"`
Host string `json:"host" yaml:"host"`
Proxy string `json:"proxy" yaml:"proxy"`
Protocol string `json:"protocol,omitempty" yaml:"protocol,omitempty"`
}
StaticRoute holds the config for each route
type TableRule ¶
type TableRule struct {
IsRealTimeEnabled bool `json:"isRealtimeEnabled" yaml:"isRealtimeEnabled"`
Rules map[string]*Rule `json:"rules" yaml:"rules"` // The key here is query, insert, update or delete
Schema string `json:"schema" yaml:"schema"`
}
TableRule contains the config at the collection level