Documentation ¶
Index ¶
- Constants
- Variables
- func Init(envFile string) error
- func InitFromEnv() error
- type AppConfig
- type DBConfig
- type Permission
- type PermissionData
- func (pd *PermissionData) DefaultData() (*PermissionData, error)
- func (pd *PermissionData) GetDefaultEnabledFrontIdList() []string
- func (pd *PermissionData) GetEnabledFrontIdList(permittedIds []string, isSuper bool) []string
- func (pd *PermissionData) GetModuleList() []string
- func (pd *PermissionData) Valid(module string) bool
- type PermissionMap
- type RedisConfig
- type RoleData
- type RoleDataMap
- type RoleId
- type RoleItem
- type RoleType
- type SMTPConfig
Constants ¶
View Source
const SuperCode = "686868"
For testing
Variables ¶
View Source
var BrandDomainName = "dizkaz.com"
View Source
var BrandName = "笛卡"
var BrandName = "DizKaz"
View Source
var ReplyDepthPageSize = 10
View Source
var Slogan = ""
Functions ¶
func InitFromEnv ¶
func InitFromEnv() error
Types ¶
type AppConfig ¶
type AppConfig struct { SessionSecret string `env:"SESSION_SECRET"` CSRFSecret string `env:"CSRF_SECRET"` DomainName string `env:"DOMAIN_NAME" envDefault:"localhost"` AppPort int `env:"APP_PORT" envDefault:"3000"` AppOuterPort int `env:"APP_OUTER_PORT" envDefault:"3000"` NginxPort int `env:"NGINX_PORT" envDefault:"80"` NginxSSLPort int `env:"NGINX_SSL_PORT" envDefault:"443"` Debug bool `env:"DEBUG" envDefault:"false"` BrandName string `env:"BRAND_NAME"` BrandDomainName string `env:"BRAND_DOMAIN_NAME"` Slogan string `env:"SLOGAN"` DB *DBConfig ReplyDepthPageSize int AdminEmail string `env:"ADMIN_EMAIL"` Redis *RedisConfig SMTP *SMTPConfig Testing bool `env:"TEST"` GoogleClientID string `env:"GOOGLE_CLIENT_ID"` GoogleClientSecret string `env:"GOOGLE_CLIENT_SECRET"` GithubClientID string `env:"GITHUB_CLIENT_ID"` GithubClientSecret string `env:"GITHUB_CLIENT_SECRET"` CloudflareSiteKey string `env:"CLOUDFLARE_SITE_KEY"` CloudflareSecret string `env:"CLOUDFLARE_SECRET"` }
var Config *AppConfig
func ParseFromEnv ¶
func (*AppConfig) GetServerURL ¶
type DBConfig ¶
type Permission ¶
type PermissionData ¶
type PermissionData struct { Modules []string Data PermissionMap // contains filtered or unexported fields }
func ParsePermissionData ¶
func ParsePermissionData(filePath string) (*PermissionData, error)
func (*PermissionData) DefaultData ¶
func (pd *PermissionData) DefaultData() (*PermissionData, error)
func (*PermissionData) GetDefaultEnabledFrontIdList ¶
func (pd *PermissionData) GetDefaultEnabledFrontIdList() []string
func (*PermissionData) GetEnabledFrontIdList ¶
func (pd *PermissionData) GetEnabledFrontIdList(permittedIds []string, isSuper bool) []string
AdaptId is to associate with backend return permission ID, witch is for the separation of frontend and backend In frontend we only use module and action name
func (*PermissionData) GetModuleList ¶
func (pd *PermissionData) GetModuleList() []string
func (*PermissionData) Valid ¶
func (pd *PermissionData) Valid(module string) bool
type PermissionMap ¶
type PermissionMap map[string]map[string]*Permission
type RedisConfig ¶
type RoleData ¶
type RoleData struct { RoleIdList []RoleId `yaml:"role_id_list,flow"` Data RoleDataMap }
func ParseRoleData ¶
type RoleDataMap ¶
Click to show internal directories.
Click to hide internal directories.