Documentation
¶
Index ¶
- type TidbConnectionManager
- type TidbStorage
- func (x *TidbStorage) Close(ctx context.Context) error
- func (x *TidbStorage) DeleteWithVersion(ctx context.Context, lockId string, exceptedVersion storage.Version, ...) error
- func (x *TidbStorage) Get(ctx context.Context, lockId string) (string, error)
- func (x *TidbStorage) GetTime(ctx context.Context) (time.Time, error)
- func (x *TidbStorage) Init(ctx context.Context) error
- func (x *TidbStorage) InsertWithVersion(ctx context.Context, lockId string, version storage.Version, ...) error
- func (x *TidbStorage) List(ctx context.Context) (iterator.Iterator[*storage.LockInformation], error)
- func (x *TidbStorage) UpdateWithVersion(ctx context.Context, lockId string, ...) error
- type TidbStorageOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TidbConnectionManager ¶
type TidbConnectionManager struct {
// tidb底层实际上都是跟mysql通用的
storage.ConnectionManager[*sql.DB]
}
TidbConnectionManager 创建一个TIDB的连接
func NewTidbConnectionProviderFromDSN ¶
func NewTidbConnectionProviderFromDSN(dsn string) *TidbConnectionManager
NewTidbConnectionProviderFromDSN 从DSN创建tidb连接
func NewTidbStorageConnectionProvider ¶
func NewTidbStorageConnectionProvider(host string, port uint, user, passwd, databaseName string) *TidbConnectionManager
NewTidbStorageConnectionProvider 从服务器属性创建数据库连接
type TidbStorage ¶
type TidbStorage struct {
// 其实底层实现跟MySQL是一样一样的,这里就直接复用mysql的storage的逻辑了
*mysql_storage.MySQLStorage
// contains filtered or unexported fields
}
TidbStorage 把锁存储在Tidb数据库中
func NewTidbStorage ¶
func NewTidbStorage(ctx context.Context, options *TidbStorageOptions) (*TidbStorage, error)
NewTidbStorage 创建一个基于tidb的storage
func (*TidbStorage) DeleteWithVersion ¶
func (x *TidbStorage) DeleteWithVersion(ctx context.Context, lockId string, exceptedVersion storage.Version, lockInformation *storage.LockInformation) error
func (*TidbStorage) InsertWithVersion ¶
func (x *TidbStorage) InsertWithVersion(ctx context.Context, lockId string, version storage.Version, lockInformation *storage.LockInformation) error
func (*TidbStorage) List ¶
func (x *TidbStorage) List(ctx context.Context) (iterator.Iterator[*storage.LockInformation], error)
func (*TidbStorage) UpdateWithVersion ¶
func (x *TidbStorage) UpdateWithVersion(ctx context.Context, lockId string, exceptedVersion, newVersion storage.Version, lockInformation *storage.LockInformation) error
type TidbStorageOptions ¶
type TidbStorageOptions struct {
*mysql_storage.MySQLStorageOptions
}
func NewTidbStorageOptions ¶
func NewTidbStorageOptions() *TidbStorageOptions
Click to show internal directories.
Click to hide internal directories.