Documentation ¶
Overview ¶
Package api lite-reader
Documentation of the lite-reader service. It is a service to schedule webhooks.
Schemes: http BasePath: / Version: 1.0.0 Host: lite-reader Consumes: - application/json Produces: - application/json
swagger:meta
Index ¶
- func BadRequest(w http.ResponseWriter, details string) error
- func InternalError(w http.ResponseWriter, details string) error
- func InvalidParams(w http.ResponseWriter, details string) error
- func NotFound(w http.ResponseWriter, details string) error
- type AddFeedRequest
- type AddFeedResponse
- type FeedService
- type GetItemsCountResponse
- type GetUnreadItemsResponse
- type ItemResponse
- type ItemService
- type JSONError
- type ListFeedResponse
- type Router
- type UpdateItemRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶
func BadRequest(w http.ResponseWriter, details string) error
BadRequest writes the BadRequest error details in json with the provided details
func InternalError ¶
func InternalError(w http.ResponseWriter, details string) error
InternalError writes the error details in json with the provided details
func InvalidParams ¶
func InvalidParams(w http.ResponseWriter, details string) error
InvalidParams writes the UnprocessableEntity error details in json with the provided details
Types ¶
type AddFeedRequest ¶
type AddFeedRequest struct {
URL string `json:"url"`
}
func (*AddFeedRequest) Validate ¶
func (r *AddFeedRequest) Validate() error
type AddFeedResponse ¶
type FeedService ¶
type GetItemsCountResponse ¶
type GetItemsCountResponse struct {
Count int `json:"count"`
}
type GetUnreadItemsResponse ¶
type GetUnreadItemsResponse struct {
Items []*ItemResponse `json:"items"`
}
type ItemResponse ¶
type ItemService ¶
type ItemService interface { GetUnreadItems() ([]*item.Item, error) GetStarredItems() ([]*item.Item, error) GetFeedItems(*item.GetFeedItemsCommand) ([]*item.Item, error) UpsertItems(command *item.UpsertItemsCommand) error UpdateItem(*item.UpdateItemCommand) error ReadFeedItems(*item.ReadFeedItemsCommand) error UnreadFeedItems(*item.UnreadFeedItemsCommand) error GetStarredItemsCount() (int, error) GetUnreadItemsCount() (int, error) DeleteFeedItems(*item.DeleteFeedItemsCommand) error }
type JSONError ¶
type JSONError struct { // Code of the error Code int `json:"code"` // Details of the error Details string `json:"details"` }
JSONError is used to return http errors encoded in json
type ListFeedResponse ¶
type ListFeedResponse []*AddFeedResponse
type Router ¶
Router handles http requests
func New ¶
func New(itemService ItemService, feedService FeedService) (*Router, error)
New creates a new handler to handle http requests
type UpdateItemRequest ¶
Click to show internal directories.
Click to hide internal directories.