driver

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCache

func NewCache(option CacheOption) *redis.Pool

NewCache create cache pool

func NewMysqlDatabase

func NewMysqlDatabase(option DBMysqlOption) (*gorp.DbMap, error)

NewMysqlDatabase return gorp dbmap object with MySQL options param

func NewPostgreDatabase

func NewPostgreDatabase(option DBPostgreOption) (*gorp.DbMap, error)

NewPostgreDatabase return gorp dbmap object with postgre options param

Types

type CacheOption

type CacheOption struct {
	Host               string
	Port               int
	DialConnectTimeout time.Duration
	ReadTimeout        time.Duration
	WriteTimeout       time.Duration
	MaxIdle            int
	MaxActive          int
	IdleTimeout        time.Duration
	Wait               bool
	MaxConnLifetime    time.Duration
	Password           string
	Namespace          string
}

CacheOption properties for cache DB

type DBMysqlOption

type DBMysqlOption struct {
	Host                 string
	Port                 int
	Username             string
	Password             string
	DBName               string
	AdditionalParameters string
	MaxOpenConns         int
	MaxIdleConns         int
	ConnMaxLifetime      time.Duration
}

DBMysqlOption options for mysql connection

type DBPostgreOption

type DBPostgreOption struct {
	Host        string
	Port        int
	Username    string
	Password    string
	DBName      string
	MaxPoolSize int
}

DBPostgreOption options for postgre connection

Jump to

Keyboard shortcuts

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