dbs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Sqlite   = "lite"
	Mysql    = "mysql"
	Postgres = "pgsql"
)

Variables

This section is empty.

Functions

func DB

func DB() *gorm.DB

func DBWithOption added in v0.1.0

func DBWithOption(conn *Connection, config *gorm.Config) *gorm.DB

func MysqlInit

func MysqlInit() *gorm.DB

func PostgresInit

func PostgresInit() *gorm.DB

func RC

func RC() redis.Cmdable

func Redis

func Redis() redis.Cmdable

func RedisCluster

func RedisCluster() redis.Cmdable

func SqliteInit

func SqliteInit() *gorm.DB

Types

type Connection

type Connection struct {
	Kind   string
	Host   string
	Port   int
	User   string
	Pass   string
	Dbname string
	Prefix string
}

type Mutex added in v0.1.0

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

func NewMutex added in v0.1.0

func NewMutex(client redis.UniversalClient, key string, options ...Option) *Mutex

func (*Mutex) TryLock added in v0.1.0

func (m *Mutex) TryLock(ctx context.Context) (bool, error)

func (*Mutex) Unlock added in v0.1.0

func (m *Mutex) Unlock(ctx context.Context) error

type Option added in v0.1.0

type Option func(*Options)

func WithLeaseDuration added in v0.1.0

func WithLeaseDuration(leaseDuration time.Duration) Option

type Options added in v0.1.0

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

type Redisson added in v0.1.0

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

func NewRedisson added in v0.1.0

func NewRedisson(redisClient *redis.Client) *Redisson

func (*Redisson) NewMutex added in v0.1.0

func (r *Redisson) NewMutex(key string, options ...Option) *Mutex

Jump to

Keyboard shortcuts

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