Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCasbin ¶
func NewCasbin(cfg CasbinConfig) (*casbin.Enforcer, error)
func NewPostgres ¶
func NewPostgres(cfg PostgresConfig) (*gorm.DB, error)
NewPostgres creates new connection to postgres and return the connection
func NewRedis ¶
func NewRedis(cfg RedisConfig) (*redis.Client, error)
NewRedis creates new connection to redis and return the connection
Types ¶
type CasbinConfig ¶
type Config ¶
type Config struct { Mode string Port string Debug string Postgres PostgresConfig Redis RedisConfig Casbin CasbinConfig }
Config is a general configuration.
var Cfg Config
Cfg is a configuration variable for the app.
type CustomValidator ¶
type CustomValidator struct {
// contains filtered or unexported fields
}
func NewCustomValidator ¶
func NewCustomValidator() *CustomValidator
func (*CustomValidator) Validate ¶
func (cv *CustomValidator) Validate(i interface{}) error
Click to show internal directories.
Click to hide internal directories.