env

package
v0.0.0-...-d36ff20 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenCasbinEnforcer

func OpenCasbinEnforcer(db *gorm.DB, re *redis_.Cluster) (*casbin.Enforcer, error)

Types

type Database

type Database struct {
	PostgreSql PostgreSql `toml:"postgresql,omitempty"`
	MySql      MySql      `toml:"mysql,omitempty"`
	SqlServer  SqlServer  `toml:"sqlserver,omitempty"`
}

func (*Database) Open

func (p *Database) Open() (*gorm.DB, error)

type GrpcClient

type GrpcClient struct {
	Host string `toml:"host"`
	Port uint16 `toml:"port"`
	Tls  Tls    `toml:"tls"`
}

https://github.com/grpc/grpc/blob/master/doc/naming.md

func (*GrpcClient) Address

func (p *GrpcClient) Address() string

func (*GrpcClient) Open

func (p *GrpcClient) Open() (*grpc.ClientConn, error)

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func (*Logger) EnableLog

func (l *Logger) EnableLog(enable bool)

func (*Logger) IsEnabled

func (l *Logger) IsEnabled() bool

func (*Logger) LogEnforce

func (l *Logger) LogEnforce(matcher string, request []interface{}, result bool, explains [][]string)

func (*Logger) LogError

func (l *Logger) LogError(err error, msg ...string)

func (*Logger) LogModel

func (l *Logger) LogModel(model [][]string)

func (*Logger) LogPolicy

func (l *Logger) LogPolicy(policy map[string][][]string)

func (*Logger) LogRole

func (l *Logger) LogRole(roles []string)

type MySql

type MySql struct {
	Host     string `toml:"host"`
	Port     uint16 `toml:"port"`
	DbName   string `toml:"dbname"`
	User     string `toml:"user"`
	Password string `toml:"password"`
	PoolSize int    `toml:"pool-size"`
}

func (*MySql) Open

func (p *MySql) Open(config *gorm.Config) (*gorm.DB, error)

type PostgreSql

type PostgreSql struct {
	Host     string `toml:"host"`
	Port     uint16 `toml:"port"`
	DbName   string `toml:"dbname"`
	User     string `toml:"user"`
	Password string `toml:"password"`
	PoolSize int    `toml:"pool-size"`
}

func (*PostgreSql) Open

func (p *PostgreSql) Open(config *gorm.Config) (*gorm.DB, error)

func (*PostgreSql) Url

func (p *PostgreSql) Url() string

type Smtp

type Smtp struct {
	Host     string   `toml:"host"`
	Port     int      `toml:"port"`
	User     string   `toml:"user"`
	Password string   `toml:"password"`
	Cc       []string `toml:"cc"`
	Bcc      []string `toml:"bcc"`
}

type SqlServer

type SqlServer struct {
	Host     string `toml:"host"`
	Port     uint16 `toml:"port"`
	DbName   string `toml:"dbname"`
	User     string `toml:"user"`
	Password string `toml:"password"`
	PoolSize int    `toml:"pool-size"`
}

func (*SqlServer) Open

func (p *SqlServer) Open(config *gorm.Config) (*gorm.DB, error)

func (*SqlServer) Url

func (p *SqlServer) Url() string

type Sqlite3

type Sqlite3 struct {
	File string `toml:"file"`
}

func (*Sqlite3) Open

func (p *Sqlite3) Open(config *gorm.Config) (*gorm.DB, error)

type Tls

type Tls struct {
	CaFile    string  `toml:"ca-file"`
	CertFile  string  `toml:"cert-file"`
	KeyFile   string  `toml:"key-file"`
	Authority *string `toml:"authority,omitempty"`
}

func (*Tls) Load

func (p *Tls) Load() (*tls.Config, error)

type Twilio

type Twilio struct {
	AccountSid string `toml:"account-sid"`
	AuthToken  string `toml:"auth-token"`
	From       string `toml:"from"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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