(app *App, w http.ResponseWriter, r *http.Request)
| 665 | } |
| 666 | |
| 667 | func viewExportFull(app *App, w http.ResponseWriter, r *http.Request) ([]byte, string, error) { |
| 668 | var err error |
| 669 | filename := "" |
| 670 | u := getUserSession(app, r) |
| 671 | if u == nil { |
| 672 | return nil, filename, ErrNotLoggedIn |
| 673 | } |
| 674 | filename = u.Username + "-" + time.Now().Truncate(time.Second).UTC().Format("200601021504") |
| 675 | |
| 676 | exportUser := compileFullExport(app, u) |
| 677 | |
| 678 | var data []byte |
| 679 | if r.FormValue("pretty") == "1" { |
| 680 | data, err = json.MarshalIndent(exportUser, "", "\t") |
| 681 | } else { |
| 682 | data, err = json.Marshal(exportUser) |
| 683 | } |
| 684 | return data, filename, err |
| 685 | } |
| 686 | |
| 687 | func viewMeAPI(app *App, w http.ResponseWriter, r *http.Request) error { |
| 688 | reqJSON := IsJSON(r) |
nothing calls this directly
no test coverage detected