Documentation
¶
Index ¶
- type AddSubscriptionResult
- type AlternateLocation
- type Category
- type ClientConfig
- type Entry
- type EntryOrigin
- type EntrySummary
- type GReader
- func (r *GReader) AddSubscription(ctx context.Context, req HttpReader, writer http.ResponseWriter)
- func (r *GReader) Auth(ctx context.Context, reader HttpReader, writer http.ResponseWriter)
- func (r *GReader) EditSubscription(ctx context.Context, req HttpReader, writer http.ResponseWriter)
- func (r *GReader) EditSubscriptionStatus(ctx context.Context, req HttpReader, writer http.ResponseWriter)
- func (r *GReader) FetchRss() error
- func (r *GReader) FetchRssBackend()
- func (r *GReader) ListItemIDs(ctx context.Context, req HttpReader, writer http.ResponseWriter)
- func (r *GReader) ListSubscription(ctx context.Context, req HttpReader, writer http.ResponseWriter)
- func (r *GReader) LoadItem(ctx context.Context, req HttpReader, writer http.ResponseWriter)
- func (r *GReader) Routers() ...
- func (r *GReader) ServeHTTP(writer http.ResponseWriter, request *http.Request)
- func (r *GReader) TagDelete(ctx context.Context, req HttpReader, writer http.ResponseWriter)
- func (r *GReader) TagList(ctx context.Context, req HttpReader, writer http.ResponseWriter)
- func (r *GReader) TagRename(ctx context.Context, req HttpReader, writer http.ResponseWriter)
- func (r *GReader) Token(ctx context.Context, req HttpReader, writer http.ResponseWriter)
- type HttpReader
- type IGReaderBackend
- type ILogger
- type Subscription
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddSubscriptionResult ¶
type AlternateLocation ¶
type AlternateLocation struct {
URL string `json:"href"`
}
type ClientConfig ¶
type ClientConfig struct {
Backend IGReaderBackend
Logger ILogger
FetchLogger ILogger
}
type Entry ¶
type Entry struct {
ID string `json:"id"`
Title string `json:"title"`
Author string `json:"author"`
PublishedTimestamp int64 `json:"published"`
CrawledTimestamp string `json:"crawlTimeMsec"`
TimestampUsec string `json:"timestampUsec"`
Summary *EntrySummary `json:"summary"`
Alternates []*AlternateLocation `json:"alternate"`
Categories []string `json:"categories"`
Origin *EntryOrigin `json:"origin"`
}
type EntryOrigin ¶
type EntrySummary ¶
type EntrySummary struct {
Content string `json:"content"`
}
type GReader ¶
type GReader struct {
// contains filtered or unexported fields
}
func New ¶
func New(config *ClientConfig) *GReader
func (*GReader) AddSubscription ¶
func (r *GReader) AddSubscription(ctx context.Context, req HttpReader, writer http.ResponseWriter)
func (*GReader) Auth ¶
func (r *GReader) Auth(ctx context.Context, reader HttpReader, writer http.ResponseWriter)
func (*GReader) EditSubscription ¶
func (r *GReader) EditSubscription(ctx context.Context, req HttpReader, writer http.ResponseWriter)
func (*GReader) EditSubscriptionStatus ¶
func (r *GReader) EditSubscriptionStatus(ctx context.Context, req HttpReader, writer http.ResponseWriter)
func (*GReader) FetchRssBackend ¶
func (r *GReader) FetchRssBackend()
func (*GReader) ListItemIDs ¶
func (r *GReader) ListItemIDs(ctx context.Context, req HttpReader, writer http.ResponseWriter)
func (*GReader) ListSubscription ¶
func (r *GReader) ListSubscription(ctx context.Context, req HttpReader, writer http.ResponseWriter)
func (*GReader) LoadItem ¶
func (r *GReader) LoadItem(ctx context.Context, req HttpReader, writer http.ResponseWriter)
func (*GReader) Routers ¶
func (r *GReader) Routers() map[[2]string]func(ctx context.Context, reader HttpReader, writer http.ResponseWriter)
func (*GReader) ServeHTTP ¶
func (r *GReader) ServeHTTP(writer http.ResponseWriter, request *http.Request)
func (*GReader) TagDelete ¶
func (r *GReader) TagDelete(ctx context.Context, req HttpReader, writer http.ResponseWriter)
func (*GReader) TagList ¶
func (r *GReader) TagList(ctx context.Context, req HttpReader, writer http.ResponseWriter)
func (*GReader) TagRename ¶
func (r *GReader) TagRename(ctx context.Context, req HttpReader, writer http.ResponseWriter)
func (*GReader) Token ¶
func (r *GReader) Token(ctx context.Context, req HttpReader, writer http.ResponseWriter)
type HttpReader ¶
type HttpReader interface {
FormList(key string) []string
FormString(key string) string
HeaderString(key string) string
QueryString(key string) string
}
func WrapStdHttpRequest ¶
func WrapStdHttpRequest(request *http.Request) HttpReader
type IGReaderBackend ¶
type IGReaderBackend interface {
// Login check username and password, return token
Login(ctx context.Context, username, password string) (string, error)
// Register register a new user
Register(ctx context.Context, username, password string) error
// ListTag list all tags
ListTag(ctx context.Context, username string) ([]string, error)
// RenameTag rename tag, from oldName to newName
RenameTag(ctx context.Context, username, oldName, newName string) error
// DeleteTag delete tag, and remove all subscription of this tag
DeleteTag(ctx context.Context, username, name string) error
// ListSubscription list all subscription
ListSubscription(ctx context.Context, username string) ([]*Subscription, error)
// AddSubscription add subscription
AddSubscription(ctx context.Context, username string, feedURL, homeURL, title string) (*Subscription, error)
// DeleteSubscription delete subscription
DeleteSubscription(ctx context.Context, username string, feedID string) error
// UpdateSubscriptionTitle update subscription's title
UpdateSubscriptionTitle(ctx context.Context, username string, feedID, title string) error
// UpdateSubscriptionTag update subscription's tag
UpdateSubscriptionTag(ctx context.Context, username string, feedID string, addTag, removeTag string) error
// ListEntryIDs list entry's id list
ListEntryIDs(ctx context.Context, username string, readed, starred *bool, feedID *string, since time.Time, count int64, continuation string) (string, []int64, error)
// UpdateEntry update entry's status
UpdateEntry(ctx context.Context, username string, entryIDs []string, read, starred *bool) error
// LoadEntry load entry by entry ids
LoadEntry(ctx context.Context, username string, entryIDs []string) ([]*Entry, error)
// ListFeedURL list all feed url
ListFeedURL(ctx context.Context) ([]string, error)
// AddFeedEntry add feed entry
AddFeedEntry(ctx context.Context, username *string, feedURL string, entryList []*Entry) error
}
type ILogger ¶
type ILogger interface {
Info(ctx context.Context, format string, args ...interface{})
Error(ctx context.Context, format string, args ...interface{})
}
func NewDefaultLogger ¶
func NewDefaultLogger() ILogger
type Subscription ¶
Source Files
¶
- api_auth.go
- api_entry_id.go
- api_entry_load.go
- api_subscription_add.go
- api_subscription_edit.go
- api_subscription_list.go
- api_subscription_tag.go
- api_tag_delete.go
- api_tag_list.go
- api_tag_rename.go
- api_token.go
- api_userinfo.go
- client.go
- fetch_rss.go
- http.go
- iface.go
- logger.go
- type_entry.go
- type_subscription.go
- type_tag.go
- type_unread_entry.go
- util.go
Click to show internal directories.
Click to hide internal directories.