Documentation
¶
Index ¶
- type CreateHighlight
- type CreateHighlightRequest
- type CreateHighlightResponse
- type ErrorResponse
- type HighlightCategory
- type ListBook
- type ListBooksResponse
- type ListHighlight
- type ListHighlightsResponse
- type Server
- func (s *Server) App() *fiber.App
- func (s *Server) CheckAuth(user, pass string) bool
- func (s *Server) CheckToken(c *fiber.Ctx, key string) (bool, error)
- func (s *Server) HandleAuth(c *fiber.Ctx) error
- func (s *Server) HandleCreateHighlights(c *fiber.Ctx) error
- func (s *Server) HandleError(c *fiber.Ctx, err error) error
- func (s *Server) HandleListBooks(c *fiber.Ctx) error
- func (s *Server) HandleListHighlights(c *fiber.Ctx) error
- func (s *Server) HandleRoot(c *fiber.Ctx) error
- func (s *Server) HandleUIDeleteHighlight(c *fiber.Ctx) error
- func (s *Server) HandleUIIndex(c *fiber.Ctx) error
- func (s *Server) HandleUIListBooks(c *fiber.Ctx) error
- func (s *Server) HandleUIListHighlights(c *fiber.Ctx) error
- func (s *Server) HandleUIUpdateHighlight(c *fiber.Ctx) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateHighlight ¶
type CreateHighlight struct {
Title string `json:"title"` // [book] book title
Author string `json:"author"` // [book] book author
SourceURL string `json:"source_url"` // [book] url of article / tweet / podcast
Category HighlightCategory `json:"category"` // [book]
Text string `json:"text"` // [highlight] highlight text
Note string `json:"note"` // [highlight] note for highlight
Chapter string `json:"chapter"` // [highlight] chapter of the book
Location int `json:"location"` // [highlight] highlights location, used to order the highlights
HighlightURL string `json:"highlight_url"` // [highlight] unique url for the highlight (e.g. a concrete tweet)
}
type CreateHighlightRequest ¶
type CreateHighlightRequest struct {
Highlights []CreateHighlight `json:"highlights"`
}
type CreateHighlightResponse ¶
type CreateHighlightResponse struct {
ID int `json:"id"` // [book] generated
Title string `json:"title"` // [book]
Author string `json:"author"` // [book]
Category HighlightCategory `json:"category"` // [book]
NumHighlights int `json:"num_highlights"` // [book] calculated from highlights
LastHighlightAt string `json:"last_highlight_at"` // [book] calculated from highlights
UpdatedAt string `json:"updated"` // [book] generated
SourceURL string `json:"source_url"` // [book]
ModifiedHighlights []int `json:"modified_highlights"` // [highlight] generated
}
type ErrorResponse ¶
type HighlightCategory ¶
type HighlightCategory string
const (
HighlightCategoryBooks HighlightCategory = "books"
)
type ListBooksResponse ¶
type ListBooksResponse struct {
Results []ListBook `json:"results"`
}
type ListHighlight ¶
type ListHighlight struct {
ID int `json:"id"` // generated
BookID int `json:"book_id"` // foreign key to Book.ID
Text string `json:"text"`
Note string `json:"note"`
Chapter string `json:"chapter"`
Location int `json:"location"`
URL string `json:"url"`
UpdatedAt string `json:"updated"` // generated
}
type ListHighlightsResponse ¶
type ListHighlightsResponse struct {
Results []ListHighlight `json:"results"`
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) HandleUIDeleteHighlight ¶ added in v0.2.2
Click to show internal directories.
Click to hide internal directories.