Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaulRole = model.Config{ Name: "Role", Plural: "roles", Base: "Role", Public: false, Properties: map[string]model.Property{ "name": { Type: "string", Required: true, }, }, Relations: &map[string]*model.Relation{}, }
View Source
var DefaultConfig = AppConfig{ Name: "example-app", Version: "0.0.1", Description: "Example app", RestApiRoot: "/api/v1", Port: 8023, Casbin: AppCasbinConfig{ DumpModels: false, Models: AppCasbinConfigModels{ DumpDirectory: "./data", }, Policies: AppCasbinConfigPolicies{ OutputDirectory: "./common/models", }, }, Env: make(map[string]interface{}), StrictSingleRelatedDocumentCheck: true, }
View Source
var DefaultDatasources = map[string]model.DataSourceConfig{
"db": {
Name: "db",
Connector: "mongodb",
Host: "localhost",
Port: 27017,
Database: "example_db",
Username: "",
Password: "",
},
}
View Source
var DefaultUser = model.Config{ Name: "User", Plural: "users", Base: "User", Public: true, Properties: map[string]model.Property{ "email": { Type: "string", Required: true, }, "password": { Type: "string", Required: true, }, }, Relations: &map[string]*model.Relation{}, Hidden: []string{"password"}, }
Functions ¶
Types ¶
type AppCasbinConfig ¶
type AppCasbinConfig struct { DumpModels bool `json:"dumpModels"` Models AppCasbinConfigModels `json:"models"` Policies AppCasbinConfigPolicies `json:"policies"` }
type AppCasbinConfigModels ¶ added in v1.8.0
type AppCasbinConfigModels struct {
DumpDirectory string `json:"dumpDirectory"`
}
type AppCasbinConfigPolicies ¶
type AppCasbinConfigPolicies struct {
OutputDirectory string `json:"outputDirectory"`
}
type AppConfig ¶
type AppConfig struct { Name string `json:"name,omitempty"` Version string `json:"version,omitempty"` Description string `json:"description,omitempty"` Casbin AppCasbinConfig `json:"casbin"` RestApiRoot string `json:"restApiRoot"` Port int `json:"port"` StrictSingleRelatedDocumentCheck bool `json:"strictSingleRelatedDocumentCheck"` Env map[string]interface{} `json:"env"` }
Click to show internal directories.
Click to hide internal directories.