dialer

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultUserName = "root"
)

Variables

This section is empty.

Functions

func DialGorm deprecated

func DialGorm(service string, opts ...OptionFunc) (*gorm.DB, error)

Deprecated: use DialMysqlGorm replace

func DialGrpc

func DialGrpc(service string, opts ...grpc.DialOption) (*grpc.ClientConn, error)

func DialGrpcWithContext

func DialGrpcWithContext(ctx context.Context, service string, opts ...grpc.DialOption) (*grpc.ClientConn, error)

func DialGrpcWithTag

func DialGrpcWithTag(service string, tag string, opts ...grpc.DialOption) (*grpc.ClientConn, error)

func DialGrpcWithTagContext

func DialGrpcWithTagContext(ctx context.Context, service string, tag string, opts ...grpc.DialOption) (*grpc.ClientConn, error)

func DialGrpcWithTagTimeout

func DialGrpcWithTagTimeout(timeout time.Duration, service, tag string, opts ...grpc.DialOption) (*grpc.ClientConn, error)

func DialGrpcWithTimeOut

func DialGrpcWithTimeOut(timeout time.Duration, service string, opts ...grpc.DialOption) (*grpc.ClientConn, error)

func DialGrpcWithUnBlock

func DialGrpcWithUnBlock(service string, opts ...grpc.DialOption) (*grpc.ClientConn, error)

func DialMysql

func DialMysql(service string, opts ...OptionFunc) (*sql.DB, error)

func DialMysqlGorm

func DialMysqlGorm(service string, opts ...OptionFunc) (*gorm.DB, error)

func DialMysqlX

func DialMysqlX(service string, opts ...OptionFunc) (*sqlx.DB, error)

func DialRedisPool

func DialRedisPool(addr string, db int, maxIdle int, password ...string) *redis.Pool

func DialSqlLiteGorm

func DialSqlLiteGorm(dbFile string, opts ...OptionFunc) (*gorm.DB, error)

Types

type DialOption

type DialOption struct {
	User     string
	Password string
	DBName   string

	SqliteCache bool
	Logger      logger.Interface
}

type OptionFunc

type OptionFunc func(*DialOption)

func WithAuth

func WithAuth(user, pwd string) OptionFunc

func WithDBName

func WithDBName(db string) OptionFunc

func WithLogger

func WithLogger(log logger.Interface) OptionFunc

func WithSqliteCache

func WithSqliteCache() OptionFunc

Jump to

Keyboard shortcuts

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