Documentation ¶
Index ¶
- func DetailsHandler[Item SonolusItem](handler SonolusService[Item]) gin.HandlerFunc
- func GetEmptyItem[ItemType SonolusItem](name string) (item ItemType, description string, err error)
- func GetEmptyList[ItemType SonolusItem](page int, queryMap map[string]string) (pageCount int, items []ItemType)
- func GetEmptyRecommend[ItemType SonolusItem](name string) (items []ItemType)
- func GetItem[ItemType SonolusItem](name string) (item ItemType, description string, err error)
- func GetList[ItemType SonolusItem](page int, queryMap map[string]string) (pageCount int, items []ItemType)
- func InfoHandler[Item SonolusItem](handler SonolusService[Item]) gin.HandlerFunc
- func ListHandler[Item SonolusItem](handler SonolusService[Item]) gin.HandlerFunc
- func ServerInfoHandler(server *Server) gin.HandlerFunc
- func SonolusVersionHandler(ctx *gin.Context)
- type Background
- type Effect
- type Engine
- type Handlers
- type ItemDetail
- type ItemInfo
- type ItemList
- type ItemSection
- type Level
- type Particle
- type Playlist
- type Post
- type Replay
- type RouterGroups
- type SRL
- type SearchSelectOption
- type SearchSliderOption
- type SearchTextOption
- type SearchToggleOption
- type Server
- type ServerInfo
- type ServerInfoFilePath
- type ServerOption
- type ServerOptionSection
- type Skin
- type SonolusCategory
- type SonolusItem
- type SonolusItemBase
- type SonolusService
- type Tag
- type UseItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetailsHandler ¶
func DetailsHandler[Item SonolusItem](handler SonolusService[Item]) gin.HandlerFunc
func GetEmptyItem ¶
func GetEmptyItem[ItemType SonolusItem](name string) (item ItemType, description string, err error)
func GetEmptyList ¶
func GetEmptyList[ItemType SonolusItem](page int, queryMap map[string]string) (pageCount int, items []ItemType)
func GetEmptyRecommend ¶
func GetEmptyRecommend[ItemType SonolusItem](name string) (items []ItemType)
func GetItem ¶
func GetItem[ItemType SonolusItem](name string) (item ItemType, description string, err error)
func GetList ¶
func GetList[ItemType SonolusItem](page int, queryMap map[string]string) (pageCount int, items []ItemType)
func InfoHandler ¶
func InfoHandler[Item SonolusItem](handler SonolusService[Item]) gin.HandlerFunc
func ListHandler ¶
func ListHandler[Item SonolusItem](handler SonolusService[Item]) gin.HandlerFunc
func SonolusVersionHandler ¶
Types ¶
type Background ¶
type Background struct { SonolusItemBase Thumbnail SRL `json:"thumbnail"` Data SRL `json:"data"` Image SRL `json:"image"` Configuration SRL `json:"configuration"` }
func (Background) GetCategory ¶
func (item Background) GetCategory() SonolusCategory
func (Background) GetName ¶
func (item Background) GetName() string
type Effect ¶
type Effect struct { SonolusItemBase Thumbnail SRL `json:"thumbnail"` Data SRL `json:"data"` Audio SRL `json:"audio"` }
func (Effect) GetCategory ¶
func (item Effect) GetCategory() SonolusCategory
type Engine ¶
type Engine struct { SonolusItemBase Skin Skin `json:"skin"` Background Background `json:"background"` Effect Effect `json:"effect"` Particle Particle `json:"particle"` Thumbnail SRL `json:"thumbnail"` PlayData SRL `json:"playData"` WatchData SRL `json:"watchData"` PreviewData SRL `json:"previewData"` TutorialData SRL `json:"tutorialData"` Rom *SRL `json:"rom,omitempty"` Configuration SRL `json:"configuration"` }
func (Engine) GetCategory ¶
func (item Engine) GetCategory() SonolusCategory
type Handlers ¶
type Handlers struct { Posts SonolusService[Post] Playlist SonolusService[Playlist] Levels SonolusService[Level] Skins SonolusService[Skin] Backgrounds SonolusService[Background] Effects SonolusService[Effect] Particles SonolusService[Particle] Engines SonolusService[Engine] Replay SonolusService[Replay] }
type ItemDetail ¶
type ItemDetail[ItemType SonolusItem] struct { Item ItemType `json:"item"` Description string `json:"description"` Sections []ItemSection[ItemType] `json:"sections"` }
type ItemInfo ¶
type ItemInfo[ItemType SonolusItem] struct { Banner SRL `json:"banner"` Sections []ItemSection[ItemType] `json:"sections"` Searches []ServerOptionSection `json:"searches"` }
type ItemList ¶
type ItemList[ItemType SonolusItem] struct { PageCount int `json:"pageCount"` Items []ItemType `json:"items"` Searches ServerOptionSection `json:"searches"` }
type ItemSection ¶
type ItemSection[ItemType SonolusItem] struct { Title string `json:"title"` Items []ItemType `json:"items"` Icon string `json:"icon"` }
type Level ¶
type Level struct { Name string `json:"name"` Source string `json:"source"` Version int `json:"version"` Rating int `json:"rating"` Title string `json:"title"` Artists string `json:"artists"` Author string `json:"author"` Tags []Tag `json:"tags"` Engine Engine `json:"engine"` UseSkin UseItem[Skin] `json:"useSkin"` UseBackground UseItem[Background] `json:"useBackground"` UseEffect UseItem[Effect] `json:"useEffect"` UseParticle UseItem[Particle] `json:"useParticle"` Cover SRL `json:"cover"` Bgm SRL `json:"bgm"` Preview *SRL `json:"preview,omitempty"` Data SRL `json:"data"` }
func (Level) GetCategory ¶
func (item Level) GetCategory() SonolusCategory
type Particle ¶
type Particle struct { SonolusItemBase Thumbnail SRL `json:"thumbnail"` Data SRL `json:"data"` Texture SRL `json:"texture"` }
func (Particle) GetCategory ¶
func (item Particle) GetCategory() SonolusCategory
type Playlist ¶
type Playlist struct { Name string `json:"name"` Source string `json:"source,omitempty"` Version int `json:"version"` Title string `json:"title"` Subtitle string `json:"subtitle"` Author string `json:"author"` Tags []Tag `json:"tags"` Levels []Level `json:"levels"` Thumbnail SRL `json:"thumbnail"` }
func (Playlist) GetCategory ¶
func (item Playlist) GetCategory() SonolusCategory
type Post ¶
type Post struct { Name string `json:"name"` Source string `json:"source,omitempty"` Version int `json:"version"` Title string `json:"title"` Time string `json:"time"` Author string `json:"author"` Tags []Tag `json:"tags"` Thumbnail SRL `json:"thumbnail"` }
func (Post) GetCategory ¶
func (item Post) GetCategory() SonolusCategory
type Replay ¶
type Replay struct { Name string `json:"name"` Source string `json:"source,omitempty"` Version int `json:"version"` Title string `json:"title"` Subtitle string `json:"subtitle"` Author string `json:"author"` Tags []Tag `json:"tags"` Levels []Level `json:"levels"` Data SRL `json:"data"` Thumbnail SRL `json:"thumbnail"` }
func (Replay) GetCategory ¶
func (item Replay) GetCategory() SonolusCategory
type RouterGroups ¶
type RouterGroups struct { Sonolus *gin.RouterGroup Posts *gin.RouterGroup Playlist *gin.RouterGroup Levels *gin.RouterGroup Skins *gin.RouterGroup Backgrounds *gin.RouterGroup Effects *gin.RouterGroup Particles *gin.RouterGroup Engines *gin.RouterGroup Replays *gin.RouterGroup }
type SearchSelectOption ¶
type SearchSelectOption struct { Query string `json:"query"` Name string `json:"name"` Type string `json:"type"` Def int `json:"def"` Values []string `json:"values,omitempty"` }
func NewSearchSelectOption ¶
func NewSearchSelectOption(query string, name string, def int, values []string) SearchSelectOption
func (SearchSelectOption) GetQuery ¶
func (o SearchSelectOption) GetQuery() string
func (SearchSelectOption) GetValueStr ¶
func (o SearchSelectOption) GetValueStr(queryResult string) string
type SearchSliderOption ¶
type SearchSliderOption struct { Query string `json:"query"` Name string `json:"name"` Type string `json:"type"` Def float64 `json:"def"` Min float64 `json:"min"` Max float64 `json:"max"` Step float64 `json:"step"` Unit string `json:"unit"` }
func NewSearchSliderOption ¶
func (SearchSliderOption) GetQuery ¶
func (o SearchSliderOption) GetQuery() string
func (SearchSliderOption) GetValueStr ¶
func (o SearchSliderOption) GetValueStr(queryResult string) string
type SearchTextOption ¶
type SearchTextOption struct { Query string `json:"query"` Name string `json:"name"` Type string `json:"type"` PlaceHolder string `json:"placeHolder"` }
func NewSearchTextOption ¶
func NewSearchTextOption(query string, name string, placeHolder string) SearchTextOption
func (SearchTextOption) GetQuery ¶
func (o SearchTextOption) GetQuery() string
func (SearchTextOption) GetValueStr ¶
func (o SearchTextOption) GetValueStr(queryResult string) string
type SearchToggleOption ¶
type SearchToggleOption struct { Query string `json:"query"` Name string `json:"name"` Type string `json:"type"` Def int `json:"def"` }
func NewSearchToggleOption ¶
func NewSearchToggleOption(query string, name string, def int) SearchToggleOption
func (SearchToggleOption) GetQuery ¶
func (o SearchToggleOption) GetQuery() string
func (SearchToggleOption) GetValueStr ¶
func (o SearchToggleOption) GetValueStr(queryResult string) string
type Server ¶
type Server struct { RepoDir string ServerName string ServerBanner SRL ServerInfo ServerInfoFilePath Handlers Handlers RouterGroups RouterGroups }
func DefaultConfig ¶
func DefaultConfig() *Server
func (*Server) LoadHandlers ¶
type ServerInfo ¶
type ServerInfoFilePath ¶
type ServerInfoFilePath struct { Posts string Playlist string Levels string Skins string Backgrounds string Effects string Particles string Engines string Replays string }
var InfoFilePath *ServerInfoFilePath
type ServerOption ¶
type ServerOptionSection ¶
type ServerOptionSection struct { Type string `json:"string"` Title string `json:"title"` Icon string `json:"icon"` Options []ServerOption `json:"options"` }
func GetEmptySearch ¶
func GetEmptySearch() (search ServerOptionSection)
type Skin ¶
type Skin struct { SonolusItemBase Thumbnail SRL `json:"thumbnail"` Data SRL `json:"data"` Texture SRL `json:"texture"` }
func (Skin) GetCategory ¶
func (item Skin) GetCategory() SonolusCategory
type SonolusCategory ¶
type SonolusCategory int
const ( CategoryPostItem SonolusCategory = iota CategoryPlaylist CategoryLevels CategorySkins CategoryBackgrounds CategoryEffect CategoryParticle CategoryEngine CategoryReplayItem TotalCategoryCnt )
type SonolusItem ¶
type SonolusItemBase ¶
type SonolusService ¶
type SonolusService[ItemType SonolusItem] struct { List func(page int, queryMap map[string]string) (pageCount int, items []ItemType) Search func() (search ServerOptionSection) Item func(name string) (item ItemType, description string, err error) Recommend func(name string) (items []ItemType) Banner SRL }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.