dbmirror

package
v2.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: MIT Imports: 7 Imported by: 5

Documentation

Overview

Package dbmirror is a package to create a database which is almost exactly the same as osu!'s beatmap database.

Index

Constants

View Source
const (
	// NewBatchEvery is the amount of time that will elapse between one batch
	// of requests and another.
	NewBatchEvery = time.Minute
	// PerBatch is the amount of requests and updates every batch contains.
	PerBatch = 100
	// SetUpdaterWorkers is the number of goroutines which should take care of
	// new batches. Keep in mind that this will be the number of maximum
	// concurrent connections to the osu! API.
	SetUpdaterWorkers = PerBatch / 20
)

Variables

This section is empty.

Functions

func Discover

func Discover(c *osuapi.Client, db *sql.DB) error

Discover discovers new beatmaps in the osu! database and adds them.

func DiscoverEvery

func DiscoverEvery(c *osuapi.Client, db *sql.DB, successWait, errorWait time.Duration)

DiscoverEvery runs Discover and waits for it to finish. If Discover returns an error, then it will wait errorWait before running Discover again. If Discover doesn't return any error, then it will wait successWait before running Discover again.

func SetHasVideo

func SetHasVideo(f func(int) (bool, error))

SetHasVideo sets the hasVideo function to the one passed.

func StartSetUpdater

func StartSetUpdater(c *osuapi.Client, db *sql.DB)

StartSetUpdater does batch updates for the beatmaps in the database, employing goroutines to fetch the data from the osu! API and then write it to the database.

Types

This section is empty.

Jump to

Keyboard shortcuts

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