Mostly finish docs

Actually start to parse things
This commit is contained in:
Caleb Gardner
2024-05-19 06:47:41 -05:00
parent f7bbdaa4b3
commit 4244b6985a
11 changed files with 270 additions and 20 deletions
+39
View File
@@ -1,5 +1,7 @@
package darkstorm
import "net/http"
type IndividualCrash struct {
Platform string
Error string
@@ -13,3 +15,40 @@ type CrashReport struct {
FirstLine string
Individual []IndividualCrash
}
func (c CrashReport) GetID() string {
return c.ID
}
type crashReq struct {
ID string
Platform string
Error string
Stack string
}
func (b *Backend) ReportCrash(w http.ResponseWriter, r *http.Request) {
hdr, err := b.ParseHeader(r)
if hdr.k == nil || hdr.k.Perm["crash"] {
w.WriteHeader(http.StatusUnauthorized)
return
}
if err != nil {
//TODO
return
}
//TODO
}
func (b *Backend) DeleteCrash(w http.ResponseWriter, r *http.Request) {
hdr, err := b.ParseHeader(r)
if hdr.k == nil || hdr.k.Perm["management"] {
w.WriteHeader(http.StatusUnauthorized)
return
}
if err != nil {
//TODO
return
}
//TODO
}