sqlx

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Code   string `db:"code"`
	Source string `db:"source"`
	Data   []byte `db:"data"`
}

type DataKeeper

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

func NewDataKeeper

func NewDataKeeper(
	db connectors.DBConnector[*sqlx.DB, *sqlx.Tx],
	opts ...DataKeeperOption,
) *DataKeeper

func (*DataKeeper) GetData

func (dk *DataKeeper) GetData(ctx context.Context) ([]*models.Data, error)

func (*DataKeeper) Init

func (dk *DataKeeper) Init(ctx context.Context) error

func (*DataKeeper) RemoveOldData

func (dk *DataKeeper) RemoveOldData(ctx context.Context) error

func (*DataKeeper) SaveData

func (dk *DataKeeper) SaveData(ctx context.Context, data *models.Data) error

func (*DataKeeper) SetFailedData

func (dk *DataKeeper) SetFailedData(ctx context.Context) error

func (*DataKeeper) UpdateFailedData

func (dk *DataKeeper) UpdateFailedData(ctx context.Context, codes []string) error

func (*DataKeeper) UpdateLockedData

func (dk *DataKeeper) UpdateLockedData(ctx context.Context) error

func (*DataKeeper) UpdateProcessedData

func (dk *DataKeeper) UpdateProcessedData(ctx context.Context, codes []string) error

type DataKeeperOption

type DataKeeperOption func(dk *DataKeeper)

func WithLockedTimeDataKeeperOpt

func WithLockedTimeDataKeeperOpt(lockedTime time.Duration) DataKeeperOption

func WithMaxAttemptsDataKeeperOpt

func WithMaxAttemptsDataKeeperOpt(maxAttempts int) DataKeeperOption

func WithRemoveOldDataDataKeeperOpt

func WithRemoveOldDataDataKeeperOpt(removeOld time.Duration) DataKeeperOption

Jump to

Keyboard shortcuts

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