miniflux/internal/reader/subscription/subscription.go

25 lines
701 B
Go
Raw Normal View History

// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
2017-11-20 06:10:04 +01: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"`
}
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