2023-06-19 17:42:47 -04:00
|
|
|
// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
2017-11-20 00:10:04 -05:00
|
|
|
|
2023-08-10 22:46:45 -04:00
|
|
|
package subscription // import "miniflux.app/v2/internal/reader/subscription"
|
2017-11-20 00:10:04 -05: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 19:07:06 -04:00
|
|
|
func NewSubscription(title, url, kind string) *Subscription {
|
|
|
|
return &Subscription{Title: title, URL: url, Type: kind}
|
|
|
|
}
|
|
|
|
|
2017-11-20 00:10:04 -05:00
|
|
|
func (s Subscription) String() string {
|
|
|
|
return fmt.Sprintf(`Title="%s", URL="%s", Type="%s"`, s.Title, s.URL, s.Type)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Subscriptions represents a list of subscription.
|
|
|
|
type Subscriptions []*Subscription
|