papernet

package
v0.0.0-...-8a4eff6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Facets

type Facets struct {
	Tags TagsFacet `json:"tags,omitempty"`
}

type Pagination

type Pagination struct {
	Total  uint64 `json:"total"`
	Limit  uint64 `json:"limit"`
	Offset uint64 `json:"offset"`
}

type Paper

type Paper struct {
	ID      int      `json:"id"`
	Title   string   `json:"title"`
	Summary string   `json:"summary"`
	Authors []string `json:"authors"`

	Tags       []string `json:"tags"`
	References []string `json:"references"`

	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

type PaperIndex

type PaperIndex interface {
	Index(*Paper) error
	Search(SearchParams) (SearchResults, error)
	Delete(int) error
}

type PaperRepository

type PaperRepository interface {
	Get(...int) ([]Paper, error)
	List() ([]Paper, error)
	Upsert(*Paper) error
	Delete(int) error
}

type SearchParams

type SearchParams struct {
	IDs  []int    `json:"ids"`
	Q    string   `json:"q"`
	Tags []string `json:"tags"`

	Limit  uint64 `json:"limit"`
	Offset uint64 `json:"offset"`
}

type SearchResults

type SearchResults struct {
	IDs        []int
	Facets     Facets
	Pagination Pagination
}

type TagIndex

type TagIndex interface {
	Index(string) error
	Search(string) ([]string, error)
}

type TagsFacet

type TagsFacet []struct {
	Tag   string `json:"tag"`
	Count int    `json:"count"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL