Documentation ¶
Overview ¶
Package solderapi is the package that defines the solder compatible api
Index ¶
- func APIRoot(w http.ResponseWriter, _ *http.Request)
- func GetBuild(w http.ResponseWriter, req *http.Request)
- func GetMod(w http.ResponseWriter, req *http.Request)
- func GetModVersion(w http.ResponseWriter, req *http.Request)
- func GetModpack(w http.ResponseWriter, req *http.Request)
- func GetModpacks(w http.ResponseWriter, r *http.Request)
- func GetMods(w http.ResponseWriter, _ *http.Request)
- func StartServer(listenAddress string)
- func VerifyKey(w http.ResponseWriter, req *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIRoot ¶
func APIRoot(w http.ResponseWriter, _ *http.Request)
APIRoot is the root function that identifies a solder compatible api Stock solder returns:
{"api":"TechnicSolder","version":"v0.7.7","stream":"DEV"}
I've never seen it not be DEV and as far as I can tell it doesn't matter what the api or version attributes are. (yes I did ask the Technic devs)
func GetBuild ¶
func GetBuild(w http.ResponseWriter, req *http.Request)
GetBuild assembles a build struct from the database and returns it as JSON
func GetMod ¶
func GetMod(w http.ResponseWriter, req *http.Request)
GetMod gets a specific mod from the database and returns it as a JSON document with the following format
{ "id":123, "name":"test-mod", "description":"This is a description of a test mod","author":"Test Author", "link":"https://example.com", "versions":["1.0"], "pretty_name":"Test Mod" }
If the mod can't be found it returns this error
func GetModVersion ¶
func GetModVersion(w http.ResponseWriter, req *http.Request)
GetModVersion is the API endpoint that returns a specific version of a mod in the following JSON format
{ "id":1, "md5":"949b3066566657167bc3da57fd1b0a83", "filesize":462, "url":"http:\/\/127.0.0.1:8080\/mods\/test-mod\/test-mod-1.0.zip" }
func GetModpack ¶
func GetModpack(w http.ResponseWriter, req *http.Request)
GetModpack gets a specific modpack and its builds and returns them in a JSON document
func GetModpacks ¶
func GetModpacks(w http.ResponseWriter, r *http.Request)
GetModpacks gets the modpack list from the database and returns it as JSON
func GetMods ¶
func GetMods(w http.ResponseWriter, _ *http.Request)
GetMods gets the list of mods from the database and displays it in a JSON document with the following format
{"mod-slug":"pretty-name",...}
Where mod-slug is the internal name used by regular solder and pretty-name is the display name
func StartServer ¶
func StartServer(listenAddress string)
StartServer Starts the http server ready to accept connections
Types ¶
This section is empty.