Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSON ¶
func JSON(w http.ResponseWriter, status int, obj interface{})
JSON helper to write json to Response writer
Types ¶
type Error ¶
type Error struct { Status int `json:"-"` Message string `json:"message"` Detail string `json:"detail"` }
Error ...
func ErrForbidden ¶
func ErrInternalServer ¶
func ErrInvalidRequest ¶
func ErrNotAllowed ¶
func ErrNotFound ¶
type HttpHandler ¶
type HttpHandler func(http.ResponseWriter, *http.Request) *Error
HttpHandler wrapper that expects a error in return
func (HttpHandler) ServeHTTP ¶
func (fn HttpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
HttpHandler's ServeHTTP method
type MultipartForm ¶
type MultipartForm struct {
Data *multipart.FileHeader `json:"data"`
}
type Server ¶
type Server struct { StorageService *service.Storage Config *confer.Config Signer *gosigner.Signer DB *bolt.DB Stats bolt.Stats // contains filtered or unexported fields }
func (*Server) CheckNonceFunc ¶
function for the signer to check nonces and store them so a nonce can't be used twice, @TODO: clean the database once in a while
func (*Server) HTTPHandler ¶
func (*Server) ImageOptionsFromRequest ¶
func (*Server) MeasureStats ¶
func (s *Server) MeasureStats()
Click to show internal directories.
Click to hide internal directories.