Documentation ¶
Overview ¶
Package sako provides access to the Wallabag API
Index ¶
- Constants
- Variables
- func Hash(v string) string
- type Annotation
- type AnnotationID
- type ClientAuth
- type Config
- type Entry
- type EntryID
- type Filter
- type FilterOptions
- func EntriesArchived(v bool) FilterOptions
- func EntriesPublic(v bool) FilterOptions
- func EntriesSince(v time.Time) FilterOptions
- func EntriesStarred(v bool) FilterOptions
- func EntriesWithDomain(name string) FilterOptions
- func EntriesWithSortCriteria(v string) FilterOptions
- func EntriesWithSortOrder(v string) FilterOptions
- func EntriesWithTags(tags ...string) FilterOptions
- func WithDetailedEntries(v bool) FilterOptions
- type Info
- type Pos
- type Range
- type Search
- type SearchOptions
- type Tag
- type TagID
- type TaggingRule
- type TaggingRuleID
- type Token
- type User
- type UserID
- type Value
Constants ¶
View Source
const ( AppName = "sako" Version = "0.1.0" WallabagAPI = "2.6.9" )
Variables ¶
View Source
var ( // ErrNotAuthenticated is the error returned when a sako client is not // authenticated and a request that needed authentication was issued. ErrNotAuthenticated = errors.New("client not authenticated") // ErrUserNotExist is the error returned when operations for or about // a non-existing user are attempted. ErrUserNotExist = errors.New("user does not exist") ErrUserAlreadyExists = errors.New("user already exists") // ErrEntryNotExist is the error returned when a non existing entry // is requested. ErrEntryNotExist = errors.New("entry does not exist") // ErrTagNotExist is the error returned when a non existing tag // is requested. ErrTagNotExist = errors.New("tag does not exist") // ErrAnnotationNotExist is the error returned when a non existing // annotation is requested. ErrAnnotationNotExist = errors.New("annotation does not exist") // ErrEmptySearchTerm is the error returned when an empty search // is requested. ErrEmptySearchTerm = errors.New("empty search term") )
Functions ¶
Types ¶
type Annotation ¶
type Annotation struct { ID AnnotationID SchemaVersion string CreatedAt time.Time UpdatedAt time.Time Quote string Text string Ranges []Range User string }
Annotation represents one annotation made to an article.
type AnnotationID ¶
type AnnotationID int64 // AnnotationID holds the unique ID for an annotation.
type ClientAuth ¶
type ClientAuth struct { ID string // ID is the oauth2 credentials identity Secret string // Secret is the oauth2 secret used for these credentials Name string // Name describes the credentials }
ClientAuth stores the user's OAuth2-like authentication credentials.
type Config ¶
type Config struct { ID int `json:"id"` ItemsPerPage int `json:"items_per_page"` Language string `json:"language"` FeedToken string `json:"feed_token"` FeedLimit int `json:"feed_limit"` ReadingSpeed float64 `json:"reading_speed"` ActionMarkAsRead int `json:"action_mark_as_read"` ListMode int `json:"list_mode"` DisplayThumbnails int `json:"display_thumbnails"` }
Config stores informations about a sako user account.
type Entry ¶
type Entry struct { ID EntryID UID string Title string URL string OriginURL string GivenURL string HashedGivenURL string HashedURL string DomainName string Tags []Tag Annotations []Annotation Content string IsArchived bool IsPublic bool IsStarred bool ArchivedAt time.Time CreatedAt time.Time UpdatedAt time.Time StarredAt time.Time PublishedAt time.Time PublishedBy []string Language string Mimetype string PreviewPicture string ReadingTime int Status string Headers map[string]string UserEmail string UserID UserID UserName string }
Entry is an article in a sako user portfolio.
type Filter ¶ added in v0.3.0
type Filter struct { Archived Value[bool] // filter by archived status. all entries by default. Starred Value[bool] // filter by starred status. all entries by default. Sort Value[string] // sort entries by date. Order Value[string] // order of sort. Page Value[int64] // page one wants. PerPage Value[int64] // number of results per page. Tags Value[[]string] // list of tags. Will returns entries that matches ALL tags. Since Value[time.Time] // The timestamp since when you want entries updated. Public Value[bool] // filter by entries with a public link. all entries by default Detailed Value[bool] // include content field if 'full'. 'full' by default for backward compatibility. Domain Value[string] // filter entries with the given domain name }
func FilterFrom ¶ added in v0.3.0
func FilterFrom(opts ...FilterOptions) (*Filter, error)
func FilterFromQuery ¶ added in v0.3.0
func (*Filter) Filter ¶ added in v0.3.0
func (f *Filter) Filter() FilterOptions
type FilterOptions ¶
func EntriesArchived ¶
func EntriesArchived(v bool) FilterOptions
func EntriesPublic ¶
func EntriesPublic(v bool) FilterOptions
func EntriesSince ¶
func EntriesSince(v time.Time) FilterOptions
func EntriesStarred ¶
func EntriesStarred(v bool) FilterOptions
func EntriesWithDomain ¶
func EntriesWithDomain(name string) FilterOptions
func EntriesWithSortCriteria ¶
func EntriesWithSortCriteria(v string) FilterOptions
criteria = created | updated | archived
func EntriesWithTags ¶
func EntriesWithTags(tags ...string) FilterOptions
func WithDetailedEntries ¶
func WithDetailedEntries(v bool) FilterOptions
type Info ¶
type Info struct { Name string `json:"appname"` Version string `json:"version"` AllowedRegistration bool `json:"allowed_registration"` }
Info stores informations about a sako/wallabag server.
type Search ¶ added in v0.3.0
type Search struct { Term Value[string] // Query term. Page Value[int64] // page one wants. PerPage Value[int64] // number of results per page. }
func SearchFromFilter ¶ added in v0.3.0
func SearchFromFilter(opts ...SearchOptions) (*Search, error)
func SearchFromQuery ¶ added in v0.3.0
func (*Search) Filter ¶ added in v0.3.0
func (s *Search) Filter() SearchOptions
type SearchOptions ¶ added in v0.3.0
func WithSearch ¶ added in v0.3.0
func WithSearch(term string) SearchOptions
type TaggingRule ¶
type TaggingRule struct { ID TaggingRuleID `json:"-"` Rule string `json:"rule"` Tags []string `json:"tags"` }
type TaggingRuleID ¶
type TaggingRuleID int64 // TaggingRuleID holds the unique ID for a tagging rule.
type Token ¶ added in v0.2.0
type Token struct { AccessToken string ExpiresAt time.Time RefreshToken string Scope string TokenType string }
Token holds authentication informations.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
sako-mgr
Command sako-import imports data from a wallabag endpoint.
|
Command sako-import imports data from a wallabag endpoint. |
sako-srv
Command sako-srv provides a sako API endpoint and a sako web server.
|
Command sako-srv provides a sako API endpoint and a sako web server. |
internal
|
|
assets
Package assets provides embedded resources.
|
Package assets provides embedded resources. |
overlayfs
Package overlyafs provides a way to overlay multiple fs.FS.
|
Package overlyafs provides a way to overlay multiple fs.FS. |
skcmd
Package skcmd gathers useful commands to manage a sako repository.
|
Package skcmd gathers useful commands to manage a sako repository. |
walla
Package walla holds types for the on-wire data from Wallabag.
|
Package walla holds types for the on-wire data from Wallabag. |
sqlite
Package sqlite implements a sako repository backed by a SQLite database.
|
Package sqlite implements a sako repository backed by a SQLite database. |
Package sksrv provides a sako server API, compatible with Wallabag's API.
|
Package sksrv provides a sako server API, compatible with Wallabag's API. |
Package skweb provides a web interface to a sako (API) server.
|
Package skweb provides a web interface to a sako (API) server. |
Click to show internal directories.
Click to hide internal directories.