boltdb

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

package boltdb implement the storage for boltdb

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store added in v1.9.1

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

Store implements storage.Store, and storage with boltdb

func NewStore added in v1.10.0

func NewStore(dataExpire int64, retryInterval int64) *Store

NewStore will return the boltdb implement TODO: change to options

func (*Store) ChangeGlobalStatus added in v1.9.1

func (s *Store) ChangeGlobalStatus(global *storage.TransGlobalStore, newStatus string, updates []string, finished bool)

ChangeGlobalStatus changes global trans status

func (*Store) CreateKV added in v1.16.4

func (s *Store) CreateKV(cat, key, value string) error

CreateKV creates key-value pair

func (*Store) DeleteKV added in v1.16.4

func (s *Store) DeleteKV(cat, key string) error

DeleteKV deletes key-value pair

func (*Store) FindBranches added in v1.9.1

func (s *Store) FindBranches(gid string) []storage.TransBranchStore

FindBranches finds Branch data by gid

func (*Store) FindKV added in v1.16.4

func (s *Store) FindKV(cat, key string) []storage.KVStore

FindKV finds key-value pairs

func (*Store) FindTransGlobalStore added in v1.9.1

func (s *Store) FindTransGlobalStore(gid string) (trans *storage.TransGlobalStore)

FindTransGlobalStore finds GlobalTrans data by gid

func (*Store) LockGlobalSaveBranches added in v1.9.1

func (s *Store) LockGlobalSaveBranches(gid string, status string, branches []storage.TransBranchStore, branchStart int)

LockGlobalSaveBranches creates branches

func (*Store) LockOneGlobalTrans added in v1.9.1

func (s *Store) LockOneGlobalTrans(expireIn time.Duration) *storage.TransGlobalStore

LockOneGlobalTrans finds GlobalTrans

func (*Store) MaySaveNewTrans added in v1.9.1

func (s *Store) MaySaveNewTrans(global *storage.TransGlobalStore, branches []storage.TransBranchStore) error

MaySaveNewTrans creates a new trans

func (*Store) Ping added in v1.9.1

func (s *Store) Ping() error

Ping execs ping cmd to boltdb

func (*Store) PopulateData added in v1.9.1

func (s *Store) PopulateData(skipDrop bool)

PopulateData populates data to boltdb

func (*Store) ResetCronTime added in v1.13.1

func (s *Store) ResetCronTime(after time.Duration, limit int64) (succeedCount int64, hasRemaining bool, err error)

ResetCronTime reset nextCronTime unfinished transactions need to be retried as soon as possible after business downtime is recovered

func (*Store) ResetTransGlobalCronTime added in v1.17.4

func (s *Store) ResetTransGlobalCronTime(g *storage.TransGlobalStore) error

ResetTransGlobalCronTime reset nextCronTime of one global trans.

func (*Store) ScanKV added in v1.16.4

func (s *Store) ScanKV(cat string, position *string, limit int64) []storage.KVStore

ScanKV lists KV pairs

func (*Store) ScanTransGlobalStores added in v1.9.1

func (s *Store) ScanTransGlobalStores(position *string, limit int64, condition storage.TransGlobalScanCondition) []storage.TransGlobalStore

ScanTransGlobalStores lists GlobalTrans data

func (*Store) TouchCronTime added in v1.9.1

func (s *Store) TouchCronTime(global *storage.TransGlobalStore, nextCronInterval int64, nextCronTime *time.Time)

TouchCronTime updates cronTime

func (*Store) UpdateBranches added in v1.9.1

func (s *Store) UpdateBranches(branches []storage.TransBranchStore, updates []string) (int, error)

UpdateBranches update branches info

func (*Store) UpdateKV added in v1.16.4

func (s *Store) UpdateKV(kv *storage.KVStore) error

UpdateKV updates key-value pair

Jump to

Keyboard shortcuts

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