mysql

package
v2.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MysqlClient

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

func (*MysqlClient) Check

func (m *MysqlClient) Check() error

func (*MysqlClient) Close

func (m *MysqlClient) Close()

func (*MysqlClient) GetConnection

func (m *MysqlClient) GetConnection(dbName ...string) (*gorm.DB, error)

func (*MysqlClient) Init

func (m *MysqlClient) Init(mysqlConfigData []byte)

func (*MysqlClient) IsMultiDB

func (m *MysqlClient) IsMultiDB() bool

func (*MysqlClient) ListConnNames

func (m *MysqlClient) ListConnNames() []string

func (*MysqlClient) UseCache

func (m *MysqlClient) UseCache() bool

type RedisCacher

type RedisCacher struct {
	Rdb        redis.UniversalClient
	Expiration time.Duration
}

1. 定义你的 Redis Cacher 结构体

func (*RedisCacher) Get

func (c *RedisCacher) Get(ctx context.Context, key string, q *caches.Query[any]) (*caches.Query[any], error)

2. 实现 Get 方法

func (*RedisCacher) Invalidate

func (c *RedisCacher) Invalidate(ctx context.Context) error

func (*RedisCacher) Store

func (c *RedisCacher) Store(ctx context.Context, key string, val *caches.Query[any]) error

Jump to

Keyboard shortcuts

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