Mostly finish docs
Actually start to parse things
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user