cnt

package
v0.0.0-...-0cfe7c7 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelXML

type ChannelXML struct {
	Items []ItemXML `xml:"item"`
}

ChannelXML represents the list of items in the RSS feed.

type Client

type Client struct{}

Client implements the cnt.Contenter interface.

func New

func New() *Client

New generates a pointer instance of Client.

func (*Client) GetItems

func (c *Client) GetItems(ctx context.Context, address string) ([]ItemXML, error)

GetItems implements the cnt.Contenter.GetItems method returning a slice of structs representing the items in the RSS feed.

func (*Client) GetText

func (c *Client) GetText(ctx context.Context, address string) (*string, error)

GetText implements the cnt.Contenter.GetText method returning the text of a target RSS item address.

type Contenter

type Contenter interface {
	GetItems(ctx context.Context, address string) ([]ItemXML, error)
	GetText(ctx context.Context, address string) (*string, error)
}

Contenter defines methods for interacting with the root blog content.

type ItemXML

type ItemXML struct {
	Link   string `xml:"link"`
	Title  string `xml:"title"`
	Number int
}

ItemXML represents an object in the target RSS feed.

type RSSXML

type RSSXML struct {
	Channel ChannelXML `xml:"channel"`
}

RSSXML represents the target RSS feed.

Jump to

Keyboard shortcuts

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