orm

package
v0.0.0-...-b8ba4b7 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MySQL

type MySQL struct {
	Host            string `yaml:"Host"`
	Port            int    `yaml:"Port"`
	DbName          string `yaml:"DbName"`
	Username        string `yaml:"Username"`
	Password        string `yaml:"Password"`
	MaxIdleConns    int    `yaml:"MaxIdleConns"`
	MaxOpenConns    int    `yaml:"MaxOpenConns"`
	ConnMaxLifetime int    `yaml:"ConnMaxLifetime"`
	Timeout         int    `yaml:"Timeout"`
	AppName         string `yaml:"AppName"`
	// Instance
	Conn *xorm.Engine
}

func NewMySQL

func NewMySQL() *MySQL

func (*MySQL) ConnString

func (this *MySQL) ConnString() string

func (*MySQL) Connect

func (this *MySQL) Connect() error

func (*MySQL) DriverName

func (this *MySQL) DriverName() string

type Postgres

type Postgres struct {
	Host            string `yaml:"Host"`
	Port            int    `yaml:"Port"`
	DbName          string `yaml:"DbName"`
	Username        string `yaml:"Username"`
	Password        string `yaml:"Password"`
	MaxIdleConns    int    `yaml:"MaxIdleConns"`
	MaxOpenConns    int    `yaml:"MaxOpenConns"`
	ConnMaxLifetime int    `yaml:"ConnMaxLifetime"`
	Timeout         int    `yaml:"Timeout"`
	AppName         string `yaml:"AppName"`
	IsCitus         bool   `yaml:"IsCitus"`
	// Instance
	Conn *xorm.Engine
}

func NewPostgres

func NewPostgres() *Postgres

func (*Postgres) ConnString

func (this *Postgres) ConnString() string

func (*Postgres) Connect

func (this *Postgres) Connect() error

func (*Postgres) DriverName

func (this *Postgres) DriverName() string

type Redis

type Redis struct {
	Auth    string `yaml:"Auth"`
	Host    string `yaml:"Host"`
	Port    int    `yaml:"Port"`
	DbIndex int    `yaml:"DbIndex"`
	Timeout string `yaml:"Timeout"`
	Maxidle int    `yaml:"Maxidle"`

	// Instance
	Conn *goredis.Redis
}

func NewRedis

func NewRedis() *Redis

func (*Redis) Connect

func (this *Redis) Connect() error

type SQLite3

type SQLite3 struct {
	Datafile string
	Conn     *xorm.Engine
}

func NewSqlite3

func NewSqlite3() *SQLite3

func (*SQLite3) Connect

func (this *SQLite3) Connect() error

func (*SQLite3) DriverName

func (this *SQLite3) DriverName() string

Jump to

Keyboard shortcuts

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