Versions in this module Expand all Collapse all v0 v0.0.1 Sep 28, 2021 Changes in this version + var Module = fx.Options(fx.Provide(NewHttpHandler), fx.Provide(NewConfig), fx.Provide(NewLogger), ...) + func SetConfigCasbinModelPath(path string) + func SetConfigPath(path string) + type AuthConfig struct + Enable bool + IgnorePathPrefixes []string + TokenExpired int + type BinderWithValidation struct + func (BinderWithValidation) Bind(i interface{}, ctx echo.Context) error + type Captcha struct + func NewCaptcha(redis Redis, logger Logger) Captcha + type CaptchaStore struct + func (a CaptchaStore) Get(id string, clear bool) string + func (a CaptchaStore) Set(id string, value string) + func (a CaptchaStore) Verify(id, answer string, clear bool) bool + type CasbinConfig struct + AutoLoad bool + AutoLoadInternal int + Debug bool + Enable bool + IgnorePathPrefixes []string + Model string + type Config struct + Auth *AuthConfig + Casbin *CasbinConfig + Database *DatabaseConfig + Http *HttpConfig + Log *LogConfig + Name string + Redis *RedisConfig + SuperAdmin *SuperAdminConfig + func NewConfig() Config + type Database struct + ORM *gorm.DB + func NewDatabase(config Config, logger Logger) Database + type DatabaseConfig struct + Engine string + Host string + MaxIdleConns int + MaxLifetime int + MaxOpenConns int + Name string + Parameters string + Password string + Port int + TablePrefix string + Username string + func (a *DatabaseConfig) DSN() string + type HttpConfig struct + Host string + Port int + func (a *HttpConfig) ListenAddr() string + type HttpHandler struct + Engine *echo.Echo + RouterV1 *echo.Group + Validate *validator.Validate + func NewHttpHandler(logger Logger, config Config) HttpHandler + type LogConfig struct + Development bool + Directory string + Format string + Level string + type Logger struct + DesugarZap *zap.Logger + Zap *zap.SugaredLogger + func NewLogger(config Config) Logger + type Redis struct + func NewRedis(config Config, logger Logger) Redis + func (a Redis) Check(keys ...string) (bool, error) + func (a Redis) Close() error + func (a Redis) Delete(keys ...string) (bool, error) + func (a Redis) Get(key string, value interface{}) error + func (a Redis) GetClient() *redis.Client + func (a Redis) Set(key string, value interface{}, expiration time.Duration) error + type RedisConfig struct + Host string + KeyPrefix string + Password string + Port int + func (a *RedisConfig) Addr() string + type SuperAdminConfig struct + Password string + Realname string + Username string + type Validator struct + func (a *Validator) Validate(i interface{}) error