database

package
v0.0.0-...-491ee29 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Discovery = ImportStage(iota)
	Comparison
	Cleanup
	Import
	Finished
)

Variables

This section is empty.

Functions

func Close

func Close()

func Init

func Init() error

func LoadBeatmaps

func LoadBeatmaps(skipDatabaseCheck bool, importListener ImportListener) []*beatmap.BeatMap

func UpdateLocalOffset

func UpdateLocalOffset(beatmap *beatmap.BeatMap)

func UpdatePlayStats

func UpdatePlayStats(beatmap *beatmap.BeatMap)

func UpdateStarRating

func UpdateStarRating(maps []*beatmap.BeatMap, progressListener func(processed, target int))

Types

type ImportListener

type ImportListener func(stage ImportStage, progress, target int)

type ImportStage

type ImportStage int

type M20181111

type M20181111 struct{}

func (*M20181111) Date

func (m *M20181111) Date() int

func (*M20181111) FieldsToMigrate

func (m *M20181111) FieldsToMigrate() []string

func (*M20181111) GetMigrationStmts

func (m *M20181111) GetMigrationStmts() string

func (*M20181111) GetValues

func (m *M20181111) GetValues(beatMap *beatmap.BeatMap) []interface{}

func (*M20181111) RequiredSections

func (m *M20181111) RequiredSections() []string

type M20201027

type M20201027 struct{}

func (*M20201027) Date

func (m *M20201027) Date() int

func (*M20201027) FieldsToMigrate

func (m *M20201027) FieldsToMigrate() []string

func (*M20201027) GetMigrationStmts

func (m *M20201027) GetMigrationStmts() string

func (*M20201027) GetValues

func (m *M20201027) GetValues(_ *beatmap.BeatMap) []interface{}

func (*M20201027) RequiredSections

func (m *M20201027) RequiredSections() []string

type M20201112

type M20201112 struct{}

func (*M20201112) Date

func (m *M20201112) Date() int

func (*M20201112) FieldsToMigrate

func (m *M20201112) FieldsToMigrate() []string

func (*M20201112) GetMigrationStmts

func (m *M20201112) GetMigrationStmts() string

func (*M20201112) GetValues

func (m *M20201112) GetValues(beatMap *beatmap.BeatMap) []interface{}

func (*M20201112) RequiredSections

func (m *M20201112) RequiredSections() []string

type M20201117

type M20201117 struct{}

func (*M20201117) Date

func (m *M20201117) Date() int

func (*M20201117) FieldsToMigrate

func (m *M20201117) FieldsToMigrate() []string

func (*M20201117) GetMigrationStmts

func (m *M20201117) GetMigrationStmts() string

func (*M20201117) GetValues

func (m *M20201117) GetValues(_ *beatmap.BeatMap) []interface{}

func (*M20201117) RequiredSections

func (m *M20201117) RequiredSections() []string

type M20201118

type M20201118 struct{}

func (*M20201118) Date

func (m *M20201118) Date() int

func (*M20201118) FieldsToMigrate

func (m *M20201118) FieldsToMigrate() []string

func (*M20201118) GetMigrationStmts

func (m *M20201118) GetMigrationStmts() string

func (*M20201118) GetValues

func (m *M20201118) GetValues(beatMap *beatmap.BeatMap) []interface{}

func (*M20201118) RequiredSections

func (m *M20201118) RequiredSections() []string

type M20210104

type M20210104 struct{}

func (*M20210104) Date

func (m *M20210104) Date() int

func (*M20210104) FieldsToMigrate

func (m *M20210104) FieldsToMigrate() []string

func (*M20210104) GetMigrationStmts

func (m *M20210104) GetMigrationStmts() string

func (*M20210104) GetValues

func (m *M20210104) GetValues(beatMap *beatmap.BeatMap) []interface{}

func (*M20210104) RequiredSections

func (m *M20210104) RequiredSections() []string

type M20210326

type M20210326 struct{}

func (*M20210326) Date

func (m *M20210326) Date() int

func (*M20210326) FieldsToMigrate

func (m *M20210326) FieldsToMigrate() []string

func (*M20210326) GetMigrationStmts

func (m *M20210326) GetMigrationStmts() string

func (*M20210326) GetValues

func (m *M20210326) GetValues(beatMap *beatmap.BeatMap) []interface{}

func (*M20210326) RequiredSections

func (m *M20210326) RequiredSections() []string

type M20210423

type M20210423 struct{}

func (*M20210423) Date

func (m *M20210423) Date() int

func (*M20210423) FieldsToMigrate

func (m *M20210423) FieldsToMigrate() []string

func (*M20210423) GetMigrationStmts

func (m *M20210423) GetMigrationStmts() string

func (*M20210423) GetValues

func (m *M20210423) GetValues(beatMap *beatmap.BeatMap) []interface{}

func (*M20210423) RequiredSections

func (m *M20210423) RequiredSections() []string

type M20220605

type M20220605 struct{}

func (*M20220605) Date

func (m *M20220605) Date() int

func (*M20220605) FieldsToMigrate

func (m *M20220605) FieldsToMigrate() []string

func (*M20220605) GetMigrationStmts

func (m *M20220605) GetMigrationStmts() string

func (*M20220605) GetValues

func (m *M20220605) GetValues(_ *beatmap.BeatMap) []interface{}

func (*M20220605) RequiredSections

func (m *M20220605) RequiredSections() []string

type M20220622

type M20220622 struct{}

func (*M20220622) Date

func (m *M20220622) Date() int

func (*M20220622) FieldsToMigrate

func (m *M20220622) FieldsToMigrate() []string

func (*M20220622) GetMigrationStmts

func (m *M20220622) GetMigrationStmts() string

func (*M20220622) GetValues

func (m *M20220622) GetValues(_ *beatmap.BeatMap) []interface{}

func (*M20220622) RequiredSections

func (m *M20220622) RequiredSections() []string

type Migration

type Migration interface {
	// Returns statements to update schema
	GetMigrationStmts() string

	// Returns required sections from .osu file
	RequiredSections() []string

	// Returns database fields to update
	FieldsToMigrate() []string

	// Returns beatmap values to update
	GetValues(beatMap *beatmap.BeatMap) []interface{}

	// Returns database version on which changes were made
	Date() int
}

Jump to

Keyboard shortcuts

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