Documentation ¶
Overview ¶
Package api contains the general framework for writing handlers in the CheeseGull API.
Index ¶
- Variables
- func CreateHandler(db, searchDB *sql.DB, house *housekeeper.House, dlc *downloader.Client) http.Handler
- func GET(path string, f func(c *Context))
- func POST(path string, f func(c *Context))
- type Context
- func (c *Context) Code(i int)
- func (c *Context) Err(err error)
- func (c *Context) Param(s string) string
- func (c *Context) ReadHeader(s string) string
- func (c *Context) Write(b []byte) (int, error)
- func (c *Context) WriteHeader(key, value string)
- func (c *Context) WriteJSON(code int, v interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Version = "2.x"
Version is set by main and it is given to requests at /
Functions ¶
func CreateHandler ¶
func CreateHandler(db, searchDB *sql.DB, house *housekeeper.House, dlc *downloader.Client) http.Handler
CreateHandler creates a new http.Handler using the handlers registered through GET and POST.
Types ¶
type Context ¶
type Context struct { Request *http.Request DB *sql.DB SearchDB *sql.DB House *housekeeper.House DLClient *downloader.Client // contains filtered or unexported fields }
Context is the information that is passed to all request handlers in relation to the request, and how to answer it.
func (*Context) ReadHeader ¶
ReadHeader reads a header from the request.
func (*Context) WriteHeader ¶
WriteHeader sets a header in the response.
Directories ¶
Path | Synopsis |
---|---|
Package download handles the API call to download an osu! beatmap set.
|
Package download handles the API call to download an osu! beatmap set. |
Package metadata handles API request that search for metadata regarding osu! beatmaps.
|
Package metadata handles API request that search for metadata regarding osu! beatmaps. |
Click to show internal directories.
Click to hide internal directories.