28 lines
1.2 KiB
Go
28 lines
1.2 KiB
Go
package dashboard
|
|
|
|
import (
|
|
"context"
|
|
"database/sql"
|
|
"time"
|
|
|
|
"github.com/go-mysql-org/go-mysql/mysql"
|
|
)
|
|
|
|
type Store interface {
|
|
WithTx(ctx context.Context, fn func(*sql.Tx) error) error
|
|
WithDashboardLock(ctx context.Context, timeout time.Duration, fn func() error) error
|
|
MarkEventApplied(ctx context.Context, tx *sql.Tx, eventKey string, source string) (bool, error)
|
|
SaveCheckpoint(ctx context.Context, pos mysql.Position) error
|
|
LoadCheckpoint(ctx context.Context) (mysql.Position, bool, error)
|
|
Cleanup(ctx context.Context) (int64, error)
|
|
|
|
UpsertUserCountry(ctx context.Context, tx *sql.Tx, user UserCountry) error
|
|
UserCountry(ctx context.Context, userID int64) (UserCountry, bool, error)
|
|
ResolveWalletGame(ctx context.Context, sysOrigin string, eventType string, eventID string) (string, string, string, error)
|
|
|
|
ApplyDailyContribution(ctx context.Context, tx *sql.Tx, c Contribution, storageZone string) error
|
|
ApplyPeriodContribution(ctx context.Context, tx *sql.Tx, c Contribution, statTimezone string) error
|
|
ApplyGamePeriodContribution(ctx context.Context, tx *sql.Tx, c Contribution, statTimezone string) error
|
|
ApplyContributionBatch(ctx context.Context, tx *sql.Tx, contributions []Contribution, storageTimezone string, statTimezones []string) error
|
|
}
|