drivers

package
v0.1.16-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitHostPort

func SplitHostPort(url string) (host, port string)

Types

type DBClient

type DBClient struct {
	*gorm.DB
}

func Mysql

func Mysql(dsn ExternalDSN) (*DBClient, error)

func Postgres

func Postgres(dsn ExternalDSN) (*DBClient, error)

func Sqlite

func Sqlite(dsn SqliteDSN) (*DBClient, error)

type ExternalDSN

type ExternalDSN struct {
	Host     string
	Name     string
	Username string
	Password string
}

type MongoClient

type MongoClient struct {
	*mongo.Client
}

func MongoDB

func MongoDB(dsn MongoDSN) (*MongoClient, error)

type MongoDSN

type MongoDSN struct {
	MongoUri string
}

type RedisClient

type RedisClient struct {
	redis.UniversalClient
}

func Redis

func Redis(dsn RedisDSN) (*RedisClient, error)

type RedisDSN

type RedisDSN struct {
	Hosts    []string
	Master   string
	Username string
	Password string
	DB       int
}

type SqliteDSN

type SqliteDSN struct {
	DB string
}

Jump to

Keyboard shortcuts

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