config

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CasbinConf

type CasbinConf struct {
	ModelText string `json:"ModelText,optional"`
}

func (CasbinConf) NewCasbin

func (l CasbinConf) NewCasbin(dbType, dsn string) (*casbin.Enforcer, error)

type DatabaseConf

type DatabaseConf struct {
	Host         string
	Port         int
	Username     string `json:",optional"`
	Password     string `json:",optional"`
	DBName       string `json:",optional"`
	SSLMode      bool   `json:",optional"`
	Type         string `json:",optional"` // "postgres" or "mysql"
	MaxOpenConns *int   `json:",optional,default=100"`
	Debug        bool   `json:",optional,default=false"`
	CacheTime    int    `json:",optional,default=10"`
}

func (DatabaseConf) GetCacheDriver added in v0.1.6

func (c DatabaseConf) GetCacheDriver(redisConf redis2.RedisConf) *entcache.Driver

func (DatabaseConf) GetDSN added in v0.1.6

func (c DatabaseConf) GetDSN() string

func (DatabaseConf) MysqlDSN

func (c DatabaseConf) MysqlDSN() string

func (DatabaseConf) PostgresDSN

func (c DatabaseConf) PostgresDSN() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL