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