config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 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      string `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) GetDSN added in v0.1.6

func (c DatabaseConf) GetDSN() string

func (DatabaseConf) MysqlDSN

func (c DatabaseConf) MysqlDSN() string

func (DatabaseConf) NewCacheDriver added in v0.1.9

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

func (DatabaseConf) NewNoCacheDriver added in v0.1.9

func (c DatabaseConf) NewNoCacheDriver() *entsql.Driver

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