subscription.go 701 B

123456789101112131415161718192021222324
  1. // SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
  2. // SPDX-License-Identifier: Apache-2.0
  3. package subscription // import "miniflux.app/v2/internal/reader/subscription"
  4. import "fmt"
  5. // subscription represents a feed subscription.
  6. type subscription struct {
  7. Title string `json:"title"`
  8. URL string `json:"url"`
  9. Type string `json:"type"`
  10. }
  11. func NewSubscription(title, url, kind string) *subscription {
  12. return &subscription{Title: title, URL: url, Type: kind}
  13. }
  14. func (s subscription) String() string {
  15. return fmt.Sprintf(`Title=%q, URL=%q, Type=%q`, s.Title, s.URL, s.Type)
  16. }
  17. // Subscriptions represents a list of subscription.
  18. type Subscriptions []*subscription