Documentation ¶
Index ¶
- Variables
- type HTTPServer
- type Pagination
- type Paper
- type Repository
- type SearchResults
- type Searcher
- type Service
- func (s *Service) Import(ctx context.Context, userID int, p Paper) (Paper, error)
- func (s *Service) RegisterHTTP(srv HTTPServer, jwtKey []byte, ac *auth.Client)
- func (s *Service) Search(ctx context.Context, userID int, q string, limit int, offset int, ...) (map[string]SearchResults, error)
- func (s *Service) Sources() []string
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("paper not found")
)
Functions ¶
This section is empty.
Types ¶
type HTTPServer ¶
Server defines the interface to register the http handlers.
type Pagination ¶
type Paper ¶
type Paper struct { ID int `json:"id"` Source string `json:"source"` Reference string `json:"reference"` Title string `json:"title"` Summary string `json:"summary"` Tags []string `json:"tags"` Authors []string `json:"authors"` References []string `json:"references"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
type Repository ¶
type SearchResults ¶
type SearchResults struct { Papers []Paper `json:"papers"` Pagination Pagination `json:"pagination"` }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repository Repository, paperClient *paper.Client, searchers ...Searcher) *Service
func (*Service) RegisterHTTP ¶
func (s *Service) RegisterHTTP(srv HTTPServer, jwtKey []byte, ac *auth.Client)
Click to show internal directories.
Click to hide internal directories.