Documentation
¶
Overview ¶
Package client implements a client library for the Miniflux REST API.
Examples ¶
This example fetches the list of users:
import (
miniflux "miniflux.app/v2/client"
)
client := miniflux.NewClient("https://api.example.org", "admin", "secret")
users, err := client.Users()
if err != nil {
fmt.Println(err)
return
}
fmt.Println(users, err)
This example discovers subscriptions on a website:
subscriptions, err := client.Discover("https://example.org/")
if err != nil {
fmt.Println(err)
return
}
fmt.Println(subscriptions)
Index ¶
- Constants
- Variables
- func SetOptionalField[T any](value T) *T
- type APIKey
- type APIKeyCreationRequest
- type APIKeys
- type Categories
- type Category
- type CategoryCreationRequest
- type CategoryModificationRequest
- type Client
- func (c *Client) APIKeys() (APIKeys, error)
- func (c *Client) APIKeysContext(ctx context.Context) (APIKeys, error)
- func (c *Client) Categories() (Categories, error)
- func (c *Client) CategoriesContext(ctx context.Context) (Categories, error)
- func (c *Client) CategoriesWithCounters() (Categories, error)
- func (c *Client) CategoriesWithCountersContext(ctx context.Context) (Categories, error)
- func (c *Client) CategoryEntries(categoryID int64, filter *Filter) (*EntryResultSet, error)
- func (c *Client) CategoryEntriesContext(ctx context.Context, categoryID int64, filter *Filter) (*EntryResultSet, error)
- func (c *Client) CategoryEntry(categoryID, entryID int64) (*Entry, error)
- func (c *Client) CategoryEntryContext(ctx context.Context, categoryID, entryID int64) (*Entry, error)
- func (c *Client) CategoryFeeds(categoryID int64) (Feeds, error)
- func (c *Client) CategoryFeedsContext(ctx context.Context, categoryID int64) (Feeds, error)
- func (c *Client) CreateAPIKey(description string) (*APIKey, error)
- func (c *Client) CreateAPIKeyContext(ctx context.Context, description string) (*APIKey, error)
- func (c *Client) CreateCategory(title string) (*Category, error)
- func (c *Client) CreateCategoryContext(ctx context.Context, title string) (*Category, error)
- func (c *Client) CreateCategoryWithOptions(createRequest *CategoryCreationRequest) (*Category, error)
- func (c *Client) CreateCategoryWithOptionsContext(ctx context.Context, createRequest *CategoryCreationRequest) (*Category, error)
- func (c *Client) CreateFeed(feedCreationRequest *FeedCreationRequest) (int64, error)
- func (c *Client) CreateFeedContext(ctx context.Context, feedCreationRequest *FeedCreationRequest) (int64, error)
- func (c *Client) CreateUser(username, password string, isAdmin bool) (*User, error)
- func (c *Client) CreateUserContext(ctx context.Context, username, password string, isAdmin bool) (*User, error)
- func (c *Client) DeleteAPIKey(apiKeyID int64) error
- func (c *Client) DeleteAPIKeyContext(ctx context.Context, apiKeyID int64) error
- func (c *Client) DeleteCategory(categoryID int64) error
- func (c *Client) DeleteCategoryContext(ctx context.Context, categoryID int64) error
- func (c *Client) DeleteFeed(feedID int64) error
- func (c *Client) DeleteFeedContext(ctx context.Context, feedID int64) error
- func (c *Client) DeleteUser(userID int64) error
- func (c *Client) DeleteUserContext(ctx context.Context, userID int64) error
- func (c *Client) Discover(url string) (Subscriptions, error)
- func (c *Client) DiscoverContext(ctx context.Context, url string) (Subscriptions, error)
- func (c *Client) Enclosure(enclosureID int64) (*Enclosure, error)
- func (c *Client) EnclosureContext(ctx context.Context, enclosureID int64) (*Enclosure, error)
- func (c *Client) Entries(filter *Filter) (*EntryResultSet, error)
- func (c *Client) EntriesContext(ctx context.Context, filter *Filter) (*EntryResultSet, error)
- func (c *Client) Entry(entryID int64) (*Entry, error)
- func (c *Client) EntryContext(ctx context.Context, entryID int64) (*Entry, error)
- func (c *Client) Export() ([]byte, error)
- func (c *Client) ExportContext(ctx context.Context) ([]byte, error)
- func (c *Client) Feed(feedID int64) (*Feed, error)
- func (c *Client) FeedContext(ctx context.Context, feedID int64) (*Feed, error)
- func (c *Client) FeedEntries(feedID int64, filter *Filter) (*EntryResultSet, error)
- func (c *Client) FeedEntriesContext(ctx context.Context, feedID int64, filter *Filter) (*EntryResultSet, error)
- func (c *Client) FeedEntry(feedID, entryID int64) (*Entry, error)
- func (c *Client) FeedEntryContext(ctx context.Context, feedID, entryID int64) (*Entry, error)
- func (c *Client) FeedIcon(feedID int64) (*FeedIcon, error)
- func (c *Client) FeedIconContext(ctx context.Context, feedID int64) (*FeedIcon, error)
- func (c *Client) Feeds() (Feeds, error)
- func (c *Client) FeedsContext(ctx context.Context) (Feeds, error)
- func (c *Client) FetchCounters() (*FeedCounters, error)
- func (c *Client) FetchCountersContext(ctx context.Context) (*FeedCounters, error)
- func (c *Client) FetchEntryOriginalContent(entryID int64) (string, error)
- func (c *Client) FetchEntryOriginalContentContext(ctx context.Context, entryID int64) (string, error)
- func (c *Client) FlushHistory() error
- func (c *Client) FlushHistoryContext(ctx context.Context) error
- func (c *Client) Healthcheck() error
- func (c *Client) HealthcheckContext(ctx context.Context) error
- func (c *Client) Icon(iconID int64) (*FeedIcon, error)
- func (c *Client) IconContext(ctx context.Context, iconID int64) (*FeedIcon, error)
- func (c *Client) Import(f io.ReadCloser) error
- func (c *Client) ImportContext(ctx context.Context, f io.ReadCloser) error
- func (c *Client) ImportFeedEntry(feedID int64, payload any) (int64, error)
- func (c *Client) IntegrationsStatus() (bool, error)
- func (c *Client) IntegrationsStatusContext(ctx context.Context) (bool, error)
- func (c *Client) MarkAllAsRead(userID int64) error
- func (c *Client) MarkAllAsReadContext(ctx context.Context, userID int64) error
- func (c *Client) MarkCategoryAsRead(categoryID int64) error
- func (c *Client) MarkCategoryAsReadContext(ctx context.Context, categoryID int64) error
- func (c *Client) MarkFeedAsRead(feedID int64) error
- func (c *Client) MarkFeedAsReadContext(ctx context.Context, feedID int64) error
- func (c *Client) Me() (*User, error)
- func (c *Client) MeContext(ctx context.Context) (*User, error)
- func (c *Client) RefreshAllFeeds() error
- func (c *Client) RefreshAllFeedsContext(ctx context.Context) error
- func (c *Client) RefreshCategory(categoryID int64) error
- func (c *Client) RefreshCategoryContext(ctx context.Context, categoryID int64) error
- func (c *Client) RefreshFeed(feedID int64) error
- func (c *Client) RefreshFeedContext(ctx context.Context, feedID int64) error
- func (c *Client) SaveEntry(entryID int64) error
- func (c *Client) SaveEntryContext(ctx context.Context, entryID int64) error
- func (c *Client) ToggleStarred(entryID int64) error
- func (c *Client) ToggleStarredContext(ctx context.Context, entryID int64) error
- func (c *Client) UpdateCategory(categoryID int64, title string) (*Category, error)
- func (c *Client) UpdateCategoryContext(ctx context.Context, categoryID int64, title string) (*Category, error)
- func (c *Client) UpdateCategoryWithOptions(categoryID int64, categoryChanges *CategoryModificationRequest) (*Category, error)
- func (c *Client) UpdateCategoryWithOptionsContext(ctx context.Context, categoryID int64, ...) (*Category, error)
- func (c *Client) UpdateEnclosure(enclosureID int64, enclosureUpdate *EnclosureUpdateRequest) error
- func (c *Client) UpdateEnclosureContext(ctx context.Context, enclosureID int64, ...) error
- func (c *Client) UpdateEntries(entryIDs []int64, status string) error
- func (c *Client) UpdateEntriesContext(ctx context.Context, entryIDs []int64, status string) error
- func (c *Client) UpdateEntry(entryID int64, entryChanges *EntryModificationRequest) (*Entry, error)
- func (c *Client) UpdateEntryContext(ctx context.Context, entryID int64, entryChanges *EntryModificationRequest) (*Entry, error)
- func (c *Client) UpdateFeed(feedID int64, feedChanges *FeedModificationRequest) (*Feed, error)
- func (c *Client) UpdateFeedContext(ctx context.Context, feedID int64, feedChanges *FeedModificationRequest) (*Feed, error)
- func (c *Client) UpdateUser(userID int64, userChanges *UserModificationRequest) (*User, error)
- func (c *Client) UpdateUserContext(ctx context.Context, userID int64, userChanges *UserModificationRequest) (*User, error)
- func (c *Client) UserByID(userID int64) (*User, error)
- func (c *Client) UserByIDContext(ctx context.Context, userID int64) (*User, error)
- func (c *Client) UserByUsername(username string) (*User, error)
- func (c *Client) UserByUsernameContext(ctx context.Context, username string) (*User, error)
- func (c *Client) Users() (Users, error)
- func (c *Client) UsersContext(ctx context.Context) (Users, error)
- func (c *Client) Version() (*VersionResponse, error)
- func (c *Client) VersionContext(ctx context.Context) (*VersionResponse, error)
- type Enclosure
- type EnclosureUpdateRequest
- type Enclosures
- type Entries
- type Entry
- type EntryModificationRequest
- type EntryResultSet
- type Feed
- type FeedCounters
- type FeedCreationRequest
- type FeedIcon
- type FeedModificationRequest
- type Feeds
- type Filter
- type Option
- type Subscription
- type Subscriptions
- type User
- type UserCreationRequest
- type UserModificationRequest
- type Users
- type VersionResponse
Constants ¶
const ( EntryStatusUnread = "unread" EntryStatusRead = "read" EntryStatusRemoved = "removed" )
Entry statuses.
const ( FilterNotStarred = "0" FilterOnlyStarred = "1" )
Variables ¶
var ( ErrNotAuthorized = errors.New("miniflux: unauthorized (bad credentials)") ErrForbidden = errors.New("miniflux: access forbidden") ErrServerError = errors.New("miniflux: internal server error") ErrNotFound = errors.New("miniflux: resource not found") ErrBadRequest = errors.New("miniflux: bad request") ErrEmptyEndpoint = errors.New("miniflux: empty endpoint provided") )
List of exposed errors.
Functions ¶
func SetOptionalField ¶ added in v2.1.2
func SetOptionalField[T any](value T) *T
SetOptionalField returns a pointer to the given value so optional request fields can be marked as set.
Types ¶
type APIKey ¶ added in v2.2.10
type APIKey struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
Token string `json:"token"`
Description string `json:"description"`
LastUsedAt *time.Time `json:"last_used_at"`
CreatedAt time.Time `json:"created_at"`
}
APIKey represents an application API key.
type APIKeyCreationRequest ¶ added in v2.2.10
type APIKeyCreationRequest struct {
Description string `json:"description"`
}
APIKeyCreationRequest represents the request to create an API key.
type Category ¶
type Category struct {
ID int64 `json:"id"`
Title string `json:"title"`
UserID int64 `json:"user_id,omitempty"`
HideGlobally bool `json:"hide_globally,omitempty"`
FeedCount *int `json:"feed_count,omitempty"`
TotalUnread *int `json:"total_unread,omitempty"`
}
Category represents a feed category.
type CategoryCreationRequest ¶ added in v2.2.8
type CategoryCreationRequest struct {
Title string `json:"title"`
HideGlobally bool `json:"hide_globally"`
}
CategoryCreationRequest represents the request to create a category.
type CategoryModificationRequest ¶ added in v2.2.8
type CategoryModificationRequest struct {
Title *string `json:"title"`
HideGlobally *bool `json:"hide_globally"`
}
CategoryModificationRequest represents the request to update a category.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client holds API procedure calls.
func NewClientWithOptions ¶ added in v2.2.14
NewClientWithOptions returns a new Miniflux client with options.
func (*Client) APIKeysContext ¶ added in v2.2.14
APIKeysContext returns all API keys for the authenticated user.
func (*Client) Categories ¶
func (c *Client) Categories() (Categories, error)
Categories retrieves the list of categories.
func (*Client) CategoriesContext ¶ added in v2.2.14
func (c *Client) CategoriesContext(ctx context.Context) (Categories, error)
CategoriesContext retrieves the list of categories.
func (*Client) CategoriesWithCounters ¶ added in v2.2.12
func (c *Client) CategoriesWithCounters() (Categories, error)
CategoriesWithCounters fetches the categories with their respective feed and unread counts.
func (*Client) CategoriesWithCountersContext ¶ added in v2.2.14
func (c *Client) CategoriesWithCountersContext(ctx context.Context) (Categories, error)
CategoriesWithCountersContext fetches the categories with their respective feed and unread counts.
func (*Client) CategoryEntries ¶
func (c *Client) CategoryEntries(categoryID int64, filter *Filter) (*EntryResultSet, error)
CategoryEntries fetches entries for a category using the given filter.
func (*Client) CategoryEntriesContext ¶ added in v2.2.14
func (c *Client) CategoryEntriesContext(ctx context.Context, categoryID int64, filter *Filter) (*EntryResultSet, error)
CategoryEntriesContext fetches category entries.
func (*Client) CategoryEntry ¶
CategoryEntry gets a single category entry.
func (*Client) CategoryEntryContext ¶ added in v2.2.14
func (c *Client) CategoryEntryContext(ctx context.Context, categoryID, entryID int64) (*Entry, error)
CategoryEntryContext gets a single category entry.
func (*Client) CategoryFeeds ¶
CategoryFeeds returns all feeds for a category.
func (*Client) CategoryFeedsContext ¶ added in v2.2.14
CategoryFeedsContext returns all feeds for a category.
func (*Client) CreateAPIKey ¶ added in v2.2.10
CreateAPIKey creates a new API key for the authenticated user.
func (*Client) CreateAPIKeyContext ¶ added in v2.2.14
CreateAPIKeyContext creates a new API key for the authenticated user.
func (*Client) CreateCategory ¶
CreateCategory creates a new category.
func (*Client) CreateCategoryContext ¶ added in v2.2.14
CreateCategoryContext creates a new category.
func (*Client) CreateCategoryWithOptions ¶ added in v2.2.8
func (c *Client) CreateCategoryWithOptions(createRequest *CategoryCreationRequest) (*Category, error)
CreateCategoryWithOptions creates a new category with options.
func (*Client) CreateCategoryWithOptionsContext ¶ added in v2.2.14
func (c *Client) CreateCategoryWithOptionsContext(ctx context.Context, createRequest *CategoryCreationRequest) (*Category, error)
CreateCategoryWithOptionsContext creates a new category with options.
func (*Client) CreateFeed ¶
func (c *Client) CreateFeed(feedCreationRequest *FeedCreationRequest) (int64, error)
CreateFeed creates a new feed.
func (*Client) CreateFeedContext ¶ added in v2.2.14
func (c *Client) CreateFeedContext(ctx context.Context, feedCreationRequest *FeedCreationRequest) (int64, error)
CreateFeedContext creates a new feed.
func (*Client) CreateUser ¶
CreateUser creates a new user in the system.
func (*Client) CreateUserContext ¶ added in v2.2.14
func (c *Client) CreateUserContext(ctx context.Context, username, password string, isAdmin bool) (*User, error)
CreateUserContext creates a new user in the system.
func (*Client) DeleteAPIKey ¶ added in v2.2.10
DeleteAPIKey removes an API key for the authenticated user.
func (*Client) DeleteAPIKeyContext ¶ added in v2.2.14
DeleteAPIKeyContext removes an API key for the authenticated user.
func (*Client) DeleteCategory ¶
DeleteCategory removes a category.
func (*Client) DeleteCategoryContext ¶ added in v2.2.14
DeleteCategoryContext removes a category.
func (*Client) DeleteFeed ¶
DeleteFeed removes a feed.
func (*Client) DeleteFeedContext ¶ added in v2.2.14
DeleteFeedContext removes a feed.
func (*Client) DeleteUser ¶
DeleteUser removes a user from the system.
func (*Client) DeleteUserContext ¶ added in v2.2.14
DeleteUserContext removes a user from the system.
func (*Client) Discover ¶
func (c *Client) Discover(url string) (Subscriptions, error)
Discover tries to find subscriptions on a website.
func (*Client) DiscoverContext ¶ added in v2.2.14
DiscoverContext tries to find subscriptions from a website.
func (*Client) EnclosureContext ¶ added in v2.2.14
EnclosureContext fetches a specific enclosure.
func (*Client) Entries ¶
func (c *Client) Entries(filter *Filter) (*EntryResultSet, error)
Entries fetches entries using the given filter.
func (*Client) EntriesContext ¶ added in v2.2.14
EntriesContext fetches entries.
func (*Client) EntryContext ¶ added in v2.2.14
EntryContext gets a single entry.
func (*Client) ExportContext ¶ added in v2.2.14
ExportContext exports subscriptions as an OPML document.
func (*Client) FeedContext ¶ added in v2.2.14
FeedContext gets a feed.
func (*Client) FeedEntries ¶
func (c *Client) FeedEntries(feedID int64, filter *Filter) (*EntryResultSet, error)
FeedEntries fetches entries for a feed using the given filter.
func (*Client) FeedEntriesContext ¶ added in v2.2.14
func (c *Client) FeedEntriesContext(ctx context.Context, feedID int64, filter *Filter) (*EntryResultSet, error)
FeedEntriesContext fetches feed entries.
func (*Client) FeedEntryContext ¶ added in v2.2.14
FeedEntryContext gets a single feed entry.
func (*Client) FeedIconContext ¶ added in v2.2.14
FeedIconContext gets a feed icon.
func (*Client) FeedsContext ¶ added in v2.2.14
FeedsContext gets all feeds.
func (*Client) FetchCounters ¶
func (c *Client) FetchCounters() (*FeedCounters, error)
FetchCounters fetches feed counters.
func (*Client) FetchCountersContext ¶ added in v2.2.14
func (c *Client) FetchCountersContext(ctx context.Context) (*FeedCounters, error)
FetchCountersContext fetches feed counters.
func (*Client) FetchEntryOriginalContent ¶ added in v2.1.2
FetchEntryOriginalContent fetches the original content of an entry using the scraper.
func (*Client) FetchEntryOriginalContentContext ¶ added in v2.2.14
func (c *Client) FetchEntryOriginalContentContext(ctx context.Context, entryID int64) (string, error)
FetchEntryOriginalContentContext fetches the original content of an entry using the scraper.
func (*Client) FlushHistory ¶ added in v2.0.49
FlushHistory changes all entries with the status "read" to "removed".
func (*Client) FlushHistoryContext ¶ added in v2.2.14
FlushHistoryContext changes all entries with the status "read" to "removed".
func (*Client) Healthcheck ¶ added in v2.1.2
Healthcheck checks if the application is up and running.
func (*Client) HealthcheckContext ¶ added in v2.2.14
HealthcheckContext checks if the application is up and running.
func (*Client) IconContext ¶ added in v2.2.14
IconContext fetches a feed icon.
func (*Client) ImportContext ¶ added in v2.2.14
ImportContext imports an OPML file.
func (*Client) ImportFeedEntry ¶ added in v2.2.16
ImportFeedEntry imports a single entry into a feed.
func (*Client) IntegrationsStatus ¶ added in v2.2.3
IntegrationsStatus fetches the integrations status for the signed-in user.
func (*Client) IntegrationsStatusContext ¶ added in v2.2.14
IntegrationsStatusContext fetches the integrations status for the signed-in user.
func (*Client) MarkAllAsRead ¶
MarkAllAsRead marks all unread entries as read for a given user.
func (*Client) MarkAllAsReadContext ¶ added in v2.2.14
MarkAllAsReadContext marks all unread entries as read for a given user.
func (*Client) MarkCategoryAsRead ¶
MarkCategoryAsRead marks all unread entries in a category as read.
func (*Client) MarkCategoryAsReadContext ¶ added in v2.2.14
MarkCategoryAsReadContext marks all unread entries in a category as read.
func (*Client) MarkFeedAsRead ¶
MarkFeedAsRead marks all unread entries of the feed as read.
func (*Client) MarkFeedAsReadContext ¶ added in v2.2.14
MarkFeedAsReadContext marks all unread entries of the feed as read.
func (*Client) RefreshAllFeeds ¶
RefreshAllFeeds refreshes all feeds.
func (*Client) RefreshAllFeedsContext ¶ added in v2.2.14
RefreshAllFeedsContext refreshes all feeds.
func (*Client) RefreshCategory ¶
RefreshCategory refreshes a category.
func (*Client) RefreshCategoryContext ¶ added in v2.2.14
RefreshCategoryContext refreshes a category.
func (*Client) RefreshFeed ¶
RefreshFeed refreshes a feed.
func (*Client) RefreshFeedContext ¶ added in v2.2.14
RefreshFeedContext refreshes a feed.
func (*Client) SaveEntryContext ¶ added in v2.2.14
SaveEntryContext sends an entry to a third-party service.
func (*Client) ToggleStarred ¶ added in v2.2.13
ToggleStarred toggles the starred flag of an entry.
func (*Client) ToggleStarredContext ¶ added in v2.2.14
ToggleStarredContext toggles entry starred value.
func (*Client) UpdateCategory ¶
UpdateCategory updates a category.
func (*Client) UpdateCategoryContext ¶ added in v2.2.14
func (c *Client) UpdateCategoryContext(ctx context.Context, categoryID int64, title string) (*Category, error)
UpdateCategoryContext updates a category.
func (*Client) UpdateCategoryWithOptions ¶ added in v2.2.8
func (c *Client) UpdateCategoryWithOptions(categoryID int64, categoryChanges *CategoryModificationRequest) (*Category, error)
UpdateCategoryWithOptions updates a category with options.
func (*Client) UpdateCategoryWithOptionsContext ¶ added in v2.2.14
func (c *Client) UpdateCategoryWithOptionsContext(ctx context.Context, categoryID int64, categoryChanges *CategoryModificationRequest) (*Category, error)
UpdateCategoryWithOptionsContext updates a category with options.
func (*Client) UpdateEnclosure ¶ added in v2.2.0
func (c *Client) UpdateEnclosure(enclosureID int64, enclosureUpdate *EnclosureUpdateRequest) error
UpdateEnclosure updates an enclosure.
func (*Client) UpdateEnclosureContext ¶ added in v2.2.14
func (c *Client) UpdateEnclosureContext(ctx context.Context, enclosureID int64, enclosureUpdate *EnclosureUpdateRequest) error
UpdateEnclosureContext updates an enclosure.
func (*Client) UpdateEntries ¶
UpdateEntries updates the status of a list of entries.
func (*Client) UpdateEntriesContext ¶ added in v2.2.14
UpdateEntriesContext updates the status of a list of entries.
func (*Client) UpdateEntry ¶ added in v2.0.49
func (c *Client) UpdateEntry(entryID int64, entryChanges *EntryModificationRequest) (*Entry, error)
UpdateEntry updates an entry.
func (*Client) UpdateEntryContext ¶ added in v2.2.14
func (c *Client) UpdateEntryContext(ctx context.Context, entryID int64, entryChanges *EntryModificationRequest) (*Entry, error)
UpdateEntryContext updates an entry.
func (*Client) UpdateFeed ¶
func (c *Client) UpdateFeed(feedID int64, feedChanges *FeedModificationRequest) (*Feed, error)
UpdateFeed updates a feed.
func (*Client) UpdateFeedContext ¶ added in v2.2.14
func (c *Client) UpdateFeedContext(ctx context.Context, feedID int64, feedChanges *FeedModificationRequest) (*Feed, error)
UpdateFeedContext updates a feed.
func (*Client) UpdateUser ¶
func (c *Client) UpdateUser(userID int64, userChanges *UserModificationRequest) (*User, error)
UpdateUser updates a user in the system.
func (*Client) UpdateUserContext ¶ added in v2.2.14
func (c *Client) UpdateUserContext(ctx context.Context, userID int64, userChanges *UserModificationRequest) (*User, error)
UpdateUserContext updates a user in the system.
func (*Client) UserByIDContext ¶ added in v2.2.14
UserByIDContext returns a single user.
func (*Client) UserByUsername ¶
UserByUsername returns a single user.
func (*Client) UserByUsernameContext ¶ added in v2.2.14
UserByUsernameContext returns a single user.
func (*Client) UsersContext ¶ added in v2.2.14
UsersContext returns all users.
func (*Client) Version ¶ added in v2.0.49
func (c *Client) Version() (*VersionResponse, error)
Version returns the version of the Miniflux instance.
func (*Client) VersionContext ¶ added in v2.2.14
func (c *Client) VersionContext(ctx context.Context) (*VersionResponse, error)
VersionContext returns the version of the Miniflux instance.
type Enclosure ¶
type Enclosure struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
EntryID int64 `json:"entry_id"`
URL string `json:"url"`
MimeType string `json:"mime_type"`
Size int `json:"size"`
MediaProgression int64 `json:"media_progression"`
}
Enclosure represents an attachment.
type EnclosureUpdateRequest ¶ added in v2.2.0
type EnclosureUpdateRequest struct {
MediaProgression int64 `json:"media_progression"`
}
type Entry ¶
type Entry struct {
ID int64 `json:"id"`
Date time.Time `json:"published_at"`
ChangedAt time.Time `json:"changed_at"`
CreatedAt time.Time `json:"created_at"`
Feed *Feed `json:"feed,omitempty"`
Hash string `json:"hash"`
URL string `json:"url"`
CommentsURL string `json:"comments_url"`
Title string `json:"title"`
Status string `json:"status"`
Content string `json:"content"`
Author string `json:"author"`
Enclosures Enclosures `json:"enclosures,omitempty"`
Tags []string `json:"tags"`
ReadingTime int `json:"reading_time"`
UserID int64 `json:"user_id"`
FeedID int64 `json:"feed_id"`
Starred bool `json:"starred"`
}
Entry represents a subscription item in the system.
type EntryModificationRequest ¶ added in v2.0.49
type EntryModificationRequest struct {
Title *string `json:"title"`
Content *string `json:"content"`
}
EntryModificationRequest represents a request to modify an entry.
type EntryResultSet ¶
EntryResultSet represents the response when fetching entries.
type Feed ¶
type Feed struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
FeedURL string `json:"feed_url"`
SiteURL string `json:"site_url"`
Title string `json:"title"`
CheckedAt time.Time `json:"checked_at"`
EtagHeader string `json:"etag_header,omitempty"`
LastModifiedHeader string `json:"last_modified_header,omitempty"`
ParsingErrorMsg string `json:"parsing_error_message,omitempty"`
ParsingErrorCount int `json:"parsing_error_count,omitempty"`
Disabled bool `json:"disabled"`
IgnoreHTTPCache bool `json:"ignore_http_cache"`
AllowSelfSignedCertificates bool `json:"allow_self_signed_certificates"`
FetchViaProxy bool `json:"fetch_via_proxy"`
ScraperRules string `json:"scraper_rules"`
RewriteRules string `json:"rewrite_rules"`
UrlRewriteRules string `json:"urlrewrite_rules"`
BlocklistRules string `json:"blocklist_rules"`
KeeplistRules string `json:"keeplist_rules"`
BlockFilterEntryRules string `json:"block_filter_entry_rules"`
KeepFilterEntryRules string `json:"keep_filter_entry_rules"`
Crawler bool `json:"crawler"`
IgnoreEntryUpdates bool `json:"ignore_entry_updates"`
UserAgent string `json:"user_agent"`
Cookie string `json:"cookie"`
Username string `json:"username"`
Password string `json:"password"`
Category *Category `json:"category,omitempty"`
HideGlobally bool `json:"hide_globally"`
DisableHTTP2 bool `json:"disable_http2"`
ProxyURL string `json:"proxy_url"`
}
Feed represents a Miniflux feed.
type FeedCounters ¶
type FeedCreationRequest ¶
type FeedCreationRequest struct {
FeedURL string `json:"feed_url"`
CategoryID int64 `json:"category_id"`
UserAgent string `json:"user_agent"`
Cookie string `json:"cookie"`
Username string `json:"username"`
Password string `json:"password"`
Crawler bool `json:"crawler"`
IgnoreEntryUpdates bool `json:"ignore_entry_updates"`
Disabled bool `json:"disabled"`
IgnoreHTTPCache bool `json:"ignore_http_cache"`
AllowSelfSignedCertificates bool `json:"allow_self_signed_certificates"`
FetchViaProxy bool `json:"fetch_via_proxy"`
ScraperRules string `json:"scraper_rules"`
RewriteRules string `json:"rewrite_rules"`
UrlRewriteRules string `json:"urlrewrite_rules"`
BlocklistRules string `json:"blocklist_rules"`
KeeplistRules string `json:"keeplist_rules"`
BlockFilterEntryRules string `json:"block_filter_entry_rules"`
KeepFilterEntryRules string `json:"keep_filter_entry_rules"`
HideGlobally bool `json:"hide_globally"`
DisableHTTP2 bool `json:"disable_http2"`
ProxyURL string `json:"proxy_url"`
}
FeedCreationRequest represents the request to create a feed.
type FeedIcon ¶
type FeedIcon struct {
ID int64 `json:"id"`
MimeType string `json:"mime_type"`
Data string `json:"data"`
}
FeedIcon represents the feed icon.
type FeedModificationRequest ¶
type FeedModificationRequest struct {
FeedURL *string `json:"feed_url"`
SiteURL *string `json:"site_url"`
Title *string `json:"title"`
ScraperRules *string `json:"scraper_rules"`
RewriteRules *string `json:"rewrite_rules"`
UrlRewriteRules *string `json:"urlrewrite_rules"`
BlocklistRules *string `json:"blocklist_rules"`
KeeplistRules *string `json:"keeplist_rules"`
BlockFilterEntryRules *string `json:"block_filter_entry_rules"`
KeepFilterEntryRules *string `json:"keep_filter_entry_rules"`
Crawler *bool `json:"crawler"`
IgnoreEntryUpdates *bool `json:"ignore_entry_updates"`
UserAgent *string `json:"user_agent"`
Cookie *string `json:"cookie"`
Username *string `json:"username"`
Password *string `json:"password"`
CategoryID *int64 `json:"category_id"`
Disabled *bool `json:"disabled"`
IgnoreHTTPCache *bool `json:"ignore_http_cache"`
AllowSelfSignedCertificates *bool `json:"allow_self_signed_certificates"`
FetchViaProxy *bool `json:"fetch_via_proxy"`
HideGlobally *bool `json:"hide_globally"`
DisableHTTP2 *bool `json:"disable_http2"`
ProxyURL *string `json:"proxy_url"`
}
FeedModificationRequest represents the request to update a feed.
type Filter ¶
type Filter struct {
Status string
Offset int
Limit int
Order string
Direction string
Starred string
Before int64
After int64
PublishedBefore int64
PublishedAfter int64
ChangedBefore int64
ChangedAfter int64
BeforeEntryID int64
AfterEntryID int64
Search string
CategoryID int64
FeedID int64
Statuses []string
GloballyVisible bool
}
Filter is used to filter entries.
type Option ¶ added in v2.2.14
type Option func(*request)
func WithAPIKey ¶ added in v2.2.14
WithAPIKey sets the API key for the client.
func WithCredentials ¶ added in v2.2.14
WithCredentials sets the username and password for the client.
func WithHTTPClient ¶ added in v2.2.14
WithHTTPClient sets the HTTP client for the client.
type Subscription ¶
type Subscription struct {
Title string `json:"title"`
URL string `json:"url"`
Type string `json:"type"`
}
Subscription represents a feed subscription.
func (Subscription) String ¶
func (s Subscription) String() string
type Subscriptions ¶
type Subscriptions []*Subscription
Subscriptions represents a list of subscriptions.
type User ¶
type User struct {
ID int64 `json:"id"`
Username string `json:"username"`
Password string `json:"password,omitempty"`
IsAdmin bool `json:"is_admin"`
Theme string `json:"theme"`
Language string `json:"language"`
Timezone string `json:"timezone"`
EntryDirection string `json:"entry_sorting_direction"`
EntryOrder string `json:"entry_sorting_order"`
Stylesheet string `json:"stylesheet"`
CustomJS string `json:"custom_js"`
GoogleID string `json:"google_id"`
OpenIDConnectID string `json:"openid_connect_id"`
EntriesPerPage int `json:"entries_per_page"`
KeyboardShortcuts bool `json:"keyboard_shortcuts"`
ShowReadingTime bool `json:"show_reading_time"`
EntrySwipe bool `json:"entry_swipe"`
LastLoginAt *time.Time `json:"last_login_at"`
DisplayMode string `json:"display_mode"`
DefaultReadingSpeed int `json:"default_reading_speed"`
CJKReadingSpeed int `json:"cjk_reading_speed"`
DefaultHomePage string `json:"default_home_page"`
CategoriesSortingOrder string `json:"categories_sorting_order"`
MarkReadOnView bool `json:"mark_read_on_view"`
MediaPlaybackRate float64 `json:"media_playback_rate"`
BlockFilterEntryRules string `json:"block_filter_entry_rules"`
KeepFilterEntryRules string `json:"keep_filter_entry_rules"`
ExternalFontHosts string `json:"external_font_hosts"`
AlwaysOpenExternalLinks bool `json:"always_open_external_links"`
OpenExternalLinksInNewTab bool `json:"open_external_links_in_new_tab"`
}
User represents a user in the system.
type UserCreationRequest ¶
type UserCreationRequest struct {
Username string `json:"username"`
Password string `json:"password"`
IsAdmin bool `json:"is_admin"`
GoogleID string `json:"google_id"`
OpenIDConnectID string `json:"openid_connect_id"`
}
UserCreationRequest represents the request to create a user.
type UserModificationRequest ¶
type UserModificationRequest struct {
Username *string `json:"username"`
Password *string `json:"password"`
IsAdmin *bool `json:"is_admin"`
Theme *string `json:"theme"`
Language *string `json:"language"`
Timezone *string `json:"timezone"`
EntryDirection *string `json:"entry_sorting_direction"`
EntryOrder *string `json:"entry_sorting_order"`
Stylesheet *string `json:"stylesheet"`
CustomJS *string `json:"custom_js"`
GoogleID *string `json:"google_id"`
OpenIDConnectID *string `json:"openid_connect_id"`
EntriesPerPage *int `json:"entries_per_page"`
KeyboardShortcuts *bool `json:"keyboard_shortcuts"`
ShowReadingTime *bool `json:"show_reading_time"`
EntrySwipe *bool `json:"entry_swipe"`
DisplayMode *string `json:"display_mode"`
DefaultReadingSpeed *int `json:"default_reading_speed"`
CJKReadingSpeed *int `json:"cjk_reading_speed"`
DefaultHomePage *string `json:"default_home_page"`
CategoriesSortingOrder *string `json:"categories_sorting_order"`
MarkReadOnView *bool `json:"mark_read_on_view"`
MediaPlaybackRate *float64 `json:"media_playback_rate"`
BlockFilterEntryRules *string `json:"block_filter_entry_rules"`
KeepFilterEntryRules *string `json:"keep_filter_entry_rules"`
ExternalFontHosts *string `json:"external_font_hosts"`
AlwaysOpenExternalLinks *bool `json:"always_open_external_links"`
OpenExternalLinksInNewTab *bool `json:"open_external_links_in_new_tab"`
}
UserModificationRequest represents the request to update a user.
type VersionResponse ¶ added in v2.0.49
type VersionResponse struct {
Version string `json:"version"`
Commit string `json:"commit"`
BuildDate string `json:"build_date"`
GoVersion string `json:"go_version"`
Compiler string `json:"compiler"`
Arch string `json:"arch"`
OS string `json:"os"`
}
VersionResponse represents the version and the build information of the Miniflux instance.