Documentation ¶
Index ¶
- Variables
- func APIAccProfileHandler(w http.ResponseWriter, r *http.Request)
- func APIAccountsHandler(w http.ResponseWriter, r *http.Request)
- func APICreateAccountHandler(w http.ResponseWriter, r *http.Request)
- func APIDeleteAccountHandler(w http.ResponseWriter, r *http.Request)
- func APIDeleteNotificationsHandler(w http.ResponseWriter, r *http.Request)
- func APISettingsEditHandler(w http.ResponseWriter, r *http.Request)
- func APIUpdateAccountHandler(w http.ResponseWriter, r *http.Request)
- func APIUpdateHandler(w http.ResponseWriter, r *http.Request)
- func APIUpdateToHandler(w http.ResponseWriter, r *http.Request)
- func AccSettingsHandler(w http.ResponseWriter, r *http.Request)
- func AccountsHandler(w http.ResponseWriter, r *http.Request)
- func AssetsHandler(w http.ResponseWriter, r *http.Request)
- func DashboardHandler(w http.ResponseWriter, r *http.Request)
- func Error(w http.ResponseWriter, e error)
- func MimeTypeMiddleware(next http.Handler) http.Handler
- func RegisterHandler(w http.ResponseWriter, r *http.Request)
- func SettingsHandler(w http.ResponseWriter, r *http.Request)
- func UpdateHandler(w http.ResponseWriter, r *http.Request)
- type Page
Constants ¶
This section is empty.
Variables ¶
var Pages = map[string]Page{}
Pages is a collection of all pages of instahelper
Functions ¶
func APIAccProfileHandler ¶
func APIAccProfileHandler(w http.ResponseWriter, r *http.Request)
APIAccProfileHandler is the handler to change the account profile settings
func APIAccountsHandler ¶
func APIAccountsHandler(w http.ResponseWriter, r *http.Request)
APIAccountsHandler will return a list of all accounts marshalled into JSON
func APICreateAccountHandler ¶
func APICreateAccountHandler(w http.ResponseWriter, r *http.Request)
APICreateAccountHandler is a http.Handler which should be used to save an account to db.
func APIDeleteAccountHandler ¶
func APIDeleteAccountHandler(w http.ResponseWriter, r *http.Request)
APIDeleteAccountHandler is the http.Handler used to delete an account from the database
func APIDeleteNotificationsHandler ¶
func APIDeleteNotificationsHandler(w http.ResponseWriter, r *http.Request)
APIDeleteNotificationsHandler is a handler to delete all notifications from the database
func APISettingsEditHandler ¶
func APISettingsEditHandler(w http.ResponseWriter, r *http.Request)
APISettingsEditHandler is the api handler for editing instahelper settings
func APIUpdateAccountHandler ¶
func APIUpdateAccountHandler(w http.ResponseWriter, r *http.Request)
APIUpdateAccountHandler is the http.Handler used to update an accounts info from the database
func APIUpdateHandler ¶
func APIUpdateHandler(w http.ResponseWriter, r *http.Request)
APIUpdateHandler is the handler used to update instahelper to the latest version
func APIUpdateToHandler ¶
func APIUpdateToHandler(w http.ResponseWriter, r *http.Request)
APIUpdateToHandler is the handler used to update instahelper to a specific version
func AccSettingsHandler ¶
func AccSettingsHandler(w http.ResponseWriter, r *http.Request)
AccSettingsHandler is the handler for the page to change account settings To add a category, edit the page and add the template html. Make sure the form has the class jobs-settings
func AccountsHandler ¶
func AccountsHandler(w http.ResponseWriter, r *http.Request)
AccountsHandler is the handler for the "Accounts" page of Instahelper
func AssetsHandler ¶
func AssetsHandler(w http.ResponseWriter, r *http.Request)
AssetsHandler is the handler for all assets packed into the binary with go-bindata
func DashboardHandler ¶
func DashboardHandler(w http.ResponseWriter, r *http.Request)
DashboardHandler is the handler for the main dashboard of Instahelper
func Error ¶
func Error(w http.ResponseWriter, e error)
Error will display the error and promt the user to report it Do not use this for api endpoints. Only for user facing pages.
func MimeTypeMiddleware ¶
MimeTypeMiddleware will set the mimetype of the content being requested
func RegisterHandler ¶
func RegisterHandler(w http.ResponseWriter, r *http.Request)
RegisterHandler is the handler for the "Add Account" page of Instahelper
func SettingsHandler ¶
func SettingsHandler(w http.ResponseWriter, r *http.Request)
SettingsHandler is the handler for instahelper settings
func UpdateHandler ¶
func UpdateHandler(w http.ResponseWriter, r *http.Request)
UpdateHandler is the handler for /update
Types ¶
type Page ¶
type Page struct { // How the pages should be arranged on the sidebar ID int // Doubles as Title Name string // Link on the sidebar Link string // Material Design Icons // Choose from https://material.io/icons/ // Replace all spaces with underscores Icon string // html/template.Template to execute Template *tpl.Template Handler http.HandlerFunc // To show it on sidebar or not Unlisted bool }
Page represents an individual page for instahelper.
func SortPages ¶
SortPages will return the list of pages sorted by ID.
See: https://stackoverflow.com/questions/18695346/how-to-sort-a-mapstringint-by-its-values