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 Eventing
- type EventingRule
- type FileRule
- type FileStore
- type Function
- type Functions
- type Modules
- type OperationConfig
- type Project
- type ProjectScope
- type Pubsub
- type PubsubRule
- 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 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"` Service string `json:"service" yaml:"service"` Function string `json:"func" yaml:"func"` Options map[string]string `json:"options" yaml:"options"` }
EventingRule holds an eventing rule
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 {
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"` FileStore *FileStore `json:"fileStore" yaml:"fileStore"` Pubsub *Pubsub `json:"pubsub" yaml:"pubsub"` 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 Pubsub ¶ added in v0.12.0
type Pubsub struct { Enabled bool `json:"enabled" yaml:"enabled"` Broker utils.Broker `json:"broker" yaml:"broker"` Conn string `json:"conn" yaml:"conn"` Rules []*PubsubRule `json:"rules" yaml:"rules"` }
Pubsub holds the config for the realtime module
type PubsubRule ¶ added in v0.12.0
type PubsubRule struct { Subject string `json:"subject" yaml:"subject"` // The channel subject Rule map[string]*Rule `json:"rule" yaml:"rule"` // The key can be publish or subscribe }
PubsubRule is the authorization object at the pubsub rule level
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
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