config

package
v0.1.4-beta Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMaxOpenCon = 100

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(c DatabaseConf) (*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"`
}

func (DatabaseConf) MysqlDSN

func (c DatabaseConf) MysqlDSN() string

func (DatabaseConf) NewEntOption

func (c DatabaseConf) NewEntOption(redisConf redis2.RedisConf) ([]ent.Option, error)

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