Documentation ¶
Index ¶
- Constants
- type Sqlite3ConnectionManager
- type Sqlite3Storage
- func (x *Sqlite3Storage) Close(ctx context.Context) error
- func (x *Sqlite3Storage) CreateWithVersion(ctx context.Context, lockId string, version storage.Version, ...) (returnError error)
- func (x *Sqlite3Storage) DeleteWithVersion(ctx context.Context, lockId string, exceptedVersion storage.Version, ...) (returnError error)
- func (x *Sqlite3Storage) Get(ctx context.Context, lockId string) (lockInformationJsonString string, returnError error)
- func (x *Sqlite3Storage) GetName() string
- func (x *Sqlite3Storage) GetTime(ctx context.Context) (now time.Time, returnError error)
- func (x *Sqlite3Storage) Init(ctx context.Context) (returnError error)
- func (x *Sqlite3Storage) List(ctx context.Context) (lockInformation iterator.Iterator[*storage.LockInformation], returnError error)
- func (x *Sqlite3Storage) UpdateWithVersion(ctx context.Context, lockId string, ...) (returnError error)
- type Sqlite3StorageOptions
Constants ¶
View Source
const SqliteConnectionManagerName = "sqlite-connection-manager"
View Source
const SqliteStorageName = "sqlite3-storage"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sqlite3ConnectionManager ¶
type Sqlite3ConnectionManager struct {
*storage.FixedSqlDBConnectionManager
}
Sqlite3ConnectionManager 用于连接到sqlite3的数据库
func NewSqlite3ConnectionManager ¶
func NewSqlite3ConnectionManager(dbPath string) (*Sqlite3ConnectionManager, error)
func (*Sqlite3ConnectionManager) Name ¶
func (x *Sqlite3ConnectionManager) Name() string
type Sqlite3Storage ¶
type Sqlite3Storage struct {
// contains filtered or unexported fields
}
func NewSqlite3Storage ¶
func NewSqlite3Storage(ctx context.Context, options *Sqlite3StorageOptions) (*Sqlite3Storage, error)
func (*Sqlite3Storage) CreateWithVersion ¶
func (x *Sqlite3Storage) CreateWithVersion(ctx context.Context, lockId string, version storage.Version, lockInformation *storage.LockInformation) (returnError error)
func (*Sqlite3Storage) DeleteWithVersion ¶
func (x *Sqlite3Storage) DeleteWithVersion(ctx context.Context, lockId string, exceptedVersion storage.Version, lockInformation *storage.LockInformation) (returnError error)
func (*Sqlite3Storage) GetName ¶
func (x *Sqlite3Storage) GetName() string
func (*Sqlite3Storage) Init ¶
func (x *Sqlite3Storage) Init(ctx context.Context) (returnError error)
func (*Sqlite3Storage) List ¶
func (x *Sqlite3Storage) List(ctx context.Context) (lockInformation iterator.Iterator[*storage.LockInformation], returnError error)
func (*Sqlite3Storage) UpdateWithVersion ¶
func (x *Sqlite3Storage) UpdateWithVersion(ctx context.Context, lockId string, exceptedVersion, newVersion storage.Version, lockInformation *storage.LockInformation) (returnError error)
type Sqlite3StorageOptions ¶
type Sqlite3StorageOptions struct { ConnectionManager storage.ConnectionManager[*sql.DB] TableName string }
func NewSqlite3StorageOptions ¶
func NewSqlite3StorageOptions() *Sqlite3StorageOptions
func (*Sqlite3StorageOptions) SetConnectionManager ¶
func (x *Sqlite3StorageOptions) SetConnectionManager(connectionManager storage.ConnectionManager[*sql.DB]) *Sqlite3StorageOptions
func (*Sqlite3StorageOptions) SetTableName ¶
func (x *Sqlite3StorageOptions) SetTableName(tableName string) *Sqlite3StorageOptions
Source Files ¶
Click to show internal directories.
Click to hide internal directories.