Documentation
¶
Overview ¶
Package cheesegull defines the basic structs and interfaces necessary for cheesegull to work.
Index ¶
Constants ¶
const ( // SortLastChecked sorts by the date last checked, in descending order SortLastChecked = iota )
These are the sorting systems for ChunkOfSets
const Version = "v0.1.0"
Version is the version of cheesegull.
Variables ¶
var ErrNoRedirect = errors.New("no redirect happened, beatmap could not be downloaded")
ErrNoRedirect is the error to return when the beatmap, while it is on the Source and has a beatmap page, does not actually have a download link, which means that the beatmap probably got removed.
Functions ¶
This section is empty.
Types ¶
type Beatmap ¶
type Beatmap struct {
BeatmapID int
ParentSetID int
DiffName string
FileMD5 string
Mode int
BPM float64
AR float32
OD float32
CS float32
HP float32
TotalLength int
HitLength int
Playcount int
Passcount int
MaxCombo int
DifficultyRating float64
}
Beatmap is a single beatmap, not an entire beatmapset.
func (*Beatmap) InheritFromOsuBeatmap ¶
InheritFromOsuBeatmap fills Beatmap with information that can be obtained by an osuapi.Beatmap.
type BeatmapDownloader ¶
BeatmapDownloader is an interface with the task to fetch a beatmap from a source. First reader is beatmap with video. Second reader is beatmap without video. If video is not in the beatmap, second reader will be nil and first reader will be beatmap without video.
type BeatmapInfoSource ¶
type BeatmapInfoSource interface {
GetBeatmaps(opts osuapi.GetBeatmapsOpts) ([]osuapi.Beatmap, error)
}
BeatmapInfoSource is a source able to provide information about multiple beatmaps. This will generally be a Client from go-osuapi, but also any mock client will fit.
type BeatmapService ¶
type BeatmapService interface {
Beatmaps(...int) ([]Beatmap, error)
BeatmapSets(...int) ([]BeatmapSet, error)
ChunkOfSets(offset, chunk, sortSystem int) ([]BeatmapSet, error)
HighestBeatmapSetID() (int, error)
SearchSets(string) ([]BeatmapSet, error)
CreateSet(BeatmapSet) error
CreateBeatmaps(...Beatmap) error
}
BeatmapService is a service connected to a database that can fetch information about beatmaps in the local DB.
type BeatmapSet ¶
type BeatmapSet struct {
SetID int
ChildrenBeatmaps []int
ChildrenBeatmaps2 []Beatmap
RankedStatus int
ApprovedDate time.Time
LastUpdate time.Time
LastChecked time.Time
Artist string
Title string
Creator string
Source string
Tags string
HasVideo bool
Genre int
Language int
Favourites int
}
BeatmapSet is a beatmapset containing a set of beatmaps.
func (*BeatmapSet) InheritFromOsuSet ¶
func (b *BeatmapSet) InheritFromOsuSet(bms []osuapi.Beatmap, recursive bool)
InheritFromOsuSet inherits properties from a slice of osuapi.Beatmaps. If recursive is enabled, ChildrenBeatmaps2 will be cleared and filled with beatmaps created with Beatmap.InheritFromOsuBeatmap.
type FileResolver ¶
type FileResolver interface {
Create(n int, noVideo bool) (io.WriteCloser, error)
Open(n int, noVideo bool) (io.ReadCloser, error)
Resolve(n int, noVideo bool) string
}
FileResolver is an interface with the task to create an io.Writer in which to save the beatmap file. Generally, this would just be a wrapper around os.Create, os.Stat, and a few sanity checks to check the destination exists.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package app contains the basic application logic and assembles together all the pieces of CheeseGull.
|
Package app contains the basic application logic and assembles together all the pieces of CheeseGull. |
|
cmd
|
|
|
cheesegull
command
cheesegull is the main application binary of CheeseGull.
|
cheesegull is the main application binary of CheeseGull. |
|
cheesegull-api
command
cheesegull is the main application binary of CheeseGull.
|
cheesegull is the main application binary of CheeseGull. |
|
cheesegull-migrate-mirror
command
cheesegull is the main application binary of CheeseGull.
|
cheesegull is the main application binary of CheeseGull. |
|
Package downloader implements downloading from the osu! website, through, well, mostly scraping and dirty hacks.
|
Package downloader implements downloading from the osu! website, through, well, mostly scraping and dirty hacks. |
|
Package http implements the CheeseGull API.
|
Package http implements the CheeseGull API. |
|
osz
Package osz handles retrieval of osz files.
|
Package osz handles retrieval of osz files. |
|
providers
|
|
|
sql
Package sql implements providers for cheesegull using SQL.
|
Package sql implements providers for cheesegull using SQL. |
