feed

package
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Enclosure

type Enclosure struct {
	Link string // Media location
	Type string // Media type
}

Enclosure represents media enclosures

type Feed

type Feed struct {
	Title       string
	Link        string
	Description string
	Language    string

	Items []Item
}

Feed contains feed contents.

func (Feed) CleanUTM

func (f Feed) CleanUTM() Feed

CleanUTM returns new Feed instance with UTM markers cleared from all links

func (*Feed) Unmarshal

func (f *Feed) Unmarshal(src []byte) error

Unmarshal fills Feed structure from byte source

type Item

type Item struct {
	Title     string      // Feed item title
	Link      string      // Feed item link
	Short     string      // Feed item short content
	Content   string      // Feed item full content
	Tags      []string    // Feed item categories
	Enclosure []Enclosure // Feed item enclosures

	PublishedAt time.Time // Feed item publish time. May be zero, if publish time wasn't read
}

Item contains feed item content.

func (Item) CleanUTM

func (i Item) CleanUTM() Item

CleanUTM returns new Item instance with UTM markers cleared from link

func (Item) GetPublishedAtOrNow

func (i Item) GetPublishedAtOrNow() time.Time

GetPublishedAtOrNow returns item publishing time or current timestamp if publish time is empty

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL