Documentation
¶
Index ¶
- Constants
- func GetCloudSQLConnectionString(dbUsername, dbPassword, unixSocketPath string) string
- func GetSchemaName(isTesting bool) string
- func NewDatabaseMigrator(db *sqlx.DB, logger *slog.Logger) *migrator
- func NewPostgresDatabase(connectionString string) (*sqlx.DB, error)
- type PlayerDataPIT
- type PostgresStatsPersistor
- type StatsPIT
- type StatsPersistor
- type StubPersistor
Constants ¶
View Source
const DATA_FORMAT_VERSION = 1
View Source
const DB_NAME = "flashlight"
View Source
const LOCAL_CONNECTION_STRING = "user=postgres password=postgres dbname=flashlight sslmode=disable"
View Source
const MAIN_SCHEMA = "flashlight"
View Source
const TESTING_SCHEMA = "flashlight_test"
Variables ¶
This section is empty.
Functions ¶
func GetSchemaName ¶
Types ¶
type PlayerDataPIT ¶
type PostgresStatsPersistor ¶
type PostgresStatsPersistor struct {
// contains filtered or unexported fields
}
func NewPostgresStatsPersistor ¶
func NewPostgresStatsPersistor(db *sqlx.DB, schema string) *PostgresStatsPersistor
func (*PostgresStatsPersistor) GetHistory ¶
func (p *PostgresStatsPersistor) GetHistory(ctx context.Context, playerUUID string, start, end time.Time, limit int) ([]PlayerDataPIT, error)
func (*PostgresStatsPersistor) StoreStats ¶
func (p *PostgresStatsPersistor) StoreStats(ctx context.Context, playerUUID string, player *processing.HypixelAPIPlayer, queriedAt time.Time) error
type StatsPersistor ¶
type StatsPersistor interface { StoreStats(ctx context.Context, playerUUID string, player *processing.HypixelAPIPlayer, queriedAt time.Time) error GetHistory(ctx context.Context, playerUUID string, start, end time.Time, limit int) ([]PlayerDataPIT, error) }
type StubPersistor ¶
type StubPersistor struct{}
func NewStubPersistor ¶
func NewStubPersistor() *StubPersistor
func (*StubPersistor) GetHistory ¶
func (p *StubPersistor) GetHistory(ctx context.Context, playerUUID string, start, end time.Time, limit int) ([]PlayerDataPIT, error)
func (*StubPersistor) StoreStats ¶
func (p *StubPersistor) StoreStats(ctx context.Context, playerUUID string, player *processing.HypixelAPIPlayer, queriedAt time.Time) error
Click to show internal directories.
Click to hide internal directories.