Documentation ¶
Index ¶
- Variables
- func NewAppListResponse(appGroups []models.AppGroup) []render.Renderer
- func NewAppResource(service services.AppService) *appResource
- func NewBookmarkListResponse(bookmarkGroups []models.BookmarkGroup) []render.Renderer
- func NewBookmarkResource() *bookmarkResource
- func NewHandler() http.Handler
- func NewStartpageResource(service services.StartpageService) *startpageResource
- type AppResponse
- type BookmarkResponse
- type ErrorResponse
- type StartpageRequest
- type StartpageResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMethodNotAllowed = &ErrorResponse{HTTPStatusCode: 405, StatusText: "Method not allowed"} ErrNotFound = &ErrorResponse{HTTPStatusCode: 404, StatusText: "Resource not found"} ErrBadRequest = &ErrorResponse{HTTPStatusCode: 400, StatusText: "Bad request"} )
View Source
var ErrDir = errors.New("path is dir")
Functions ¶
func NewAppListResponse ¶ added in v0.3.0
func NewAppResource ¶ added in v0.3.0
func NewAppResource(service services.AppService) *appResource
func NewBookmarkListResponse ¶ added in v0.3.0
func NewBookmarkListResponse(bookmarkGroups []models.BookmarkGroup) []render.Renderer
func NewBookmarkResource ¶ added in v0.3.0
func NewBookmarkResource() *bookmarkResource
func NewHandler ¶ added in v0.3.0
func NewStartpageResource ¶
func NewStartpageResource(service services.StartpageService) *startpageResource
Types ¶
type AppResponse ¶ added in v0.3.0
func NewAppResponse ¶ added in v0.3.0
func NewAppResponse(appGroup models.AppGroup) *AppResponse
func (*AppResponse) Render ¶ added in v0.3.0
func (rd *AppResponse) Render(w http.ResponseWriter, r *http.Request) error
type BookmarkResponse ¶ added in v0.3.0
type BookmarkResponse struct {
models.BookmarkGroup
}
func NewBookmarkResponse ¶ added in v0.3.0
func NewBookmarkResponse(bookmarkGroup models.BookmarkGroup) *BookmarkResponse
func (*BookmarkResponse) Render ¶ added in v0.3.0
func (rd *BookmarkResponse) Render(w http.ResponseWriter, r *http.Request) error
type ErrorResponse ¶ added in v0.3.0
type ErrorResponse struct { Err error `json:"-"` // low-level runtime error HTTPStatusCode int `json:"-"` // http response status code StatusText string `json:"status"` // user-level status message AppCode int64 `json:"code,omitempty"` // application-specific error code ErrorText string `json:"error,omitempty"` // application-level error message, for debugging }
func ErrInvalidRequest ¶
func ErrInvalidRequest(err error) *ErrorResponse
func ErrServerError ¶ added in v0.3.0
func ErrServerError(err error) *ErrorResponse
func (*ErrorResponse) Render ¶ added in v0.3.0
func (e *ErrorResponse) Render(w http.ResponseWriter, r *http.Request) error
type StartpageRequest ¶
type StartpageResponse ¶
func NewStartpageResponse ¶
func NewStartpageResponse(startpage *models.Startpage) *StartpageResponse
func (*StartpageResponse) Render ¶
func (rd *StartpageResponse) Render(w http.ResponseWriter, r *http.Request) error
Click to show internal directories.
Click to hide internal directories.