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 Deploy
- type FileRule
- type FileStore
- type Function
- type Functions
- type Modules
- type OperationConfig
- type Project
- type ProjectScope
- type Realtime
- type Registry
- type Rule
- type SSL
- type Service
- type Services
- 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:"operatiop"` 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"` Deploy Deploy `json:"deploy" yaml:"deploy"` Static *Static `json:"gateway" yaml:"gateway"` Cluster string `json:"cluster" yaml:"cluster"` NodeID string `json:"nodeId" yaml:"nodeId"` }
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 { 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 Deploy ¶ added in v0.10.0
type Deploy struct { Orchestrator utils.OrchestratorType `json:"orchestrator,omitempty" yaml:"orchestrator,omitempty"` Registry Registry `json:"registry,omitempty" yaml:"registry,omitempty"` Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` Enabled bool `json:"enabled" yaml:"enabled"` }
Deploy holds the deployment environment config
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"` 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 Function ¶ added in v0.11.0
type Function struct {
Rule *Rule `json:"rule" yaml:"rule"`
}
Function holds the config of a function
type Functions ¶
type Functions struct { Enabled bool `json:"enabled" yaml:"enabled"` Broker utils.Broker `json:"broker" yaml:"broker"` Conn string `json:"conn" yaml:"conn"` Services Services `json:"services" yaml:"services"` }
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"` }
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 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 Registry ¶ added in v0.10.0
type Registry struct { URL string `json:"url" yaml:"url"` ID string `json:"id" yaml:"id"` Key string `json:"key" yaml:"key"` Token *string `json:"token,omitempty" yaml:"token,omitempty"` }
Registry holds the details of the registry
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"` Service string `json:"service,omitempty" yaml:"service,omitempty"` Func string `json:"func,omitempty" yaml:"func,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 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