2023-06-19 14:42:47 -07:00
|
|
|
// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
2017-11-19 21:10:04 -08:00
|
|
|
|
2023-08-10 19:46:45 -07:00
|
|
|
package subscription // import "miniflux.app/v2/internal/reader/subscription"
|
2017-11-19 21:10:04 -08:00
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
// Subscription represents a feed subscription.
|
|
|
|
type Subscription struct {
|
|
|
|
Title string `json:"title"`
|
|
|
|
URL string `json:"url"`
|
|
|
|
Type string `json:"type"`
|
|
|
|
}
|
|
|
|
|
2023-10-22 16:07:06 -07:00
|
|
|
func NewSubscription(title, url, kind string) *Subscription {
|
|
|
|
return &Subscription{Title: title, URL: url, Type: kind}
|
|
|
|
}
|
|
|
|
|
2017-11-19 21:10:04 -08:00
|
|
|
func (s Subscription) String() string {
|
2024-02-29 00:27:39 +01:00
|
|
|
return fmt.Sprintf(`Title=%q, URL=%q, Type=%q`, s.Title, s.URL, s.Type)
|
2017-11-19 21:10:04 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Subscriptions represents a list of subscription.
|
|
|
|
type Subscriptions []*Subscription
|