jsonfeed

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: MIT Imports: 5 Imported by: 0

README

json-feed-go

Documentation

Index

Constants

View Source
const CurrentVersion string = "https://jsonfeed.org/version/1.1"

Variables

This section is empty.

Functions

func FromBytes added in v0.2.0

func FromBytes[F FeedConstraint](jsonBytes []byte) (feed *F, err error)

func FromReader added in v0.2.0

func FromReader[F FeedConstraint](reader io.Reader) (feed *F, err error)

func FromString added in v0.2.0

func FromString[F FeedConstraint](jsonStr string) (feed *F, err error)

func Ptr added in v0.3.0

func Ptr[T any](in T) *T

Types

type Attachment

type Attachment struct {
	Url               string  `json:"url"`
	MimeType          string  `json:"mime_type"`
	Title             *string `json:"title"`
	SizeInBytes       *int    `json:"size_in_bytes"`
	DurationInSeconds *int    `json:"duration_in_seconds"`
}

func (*Attachment) IsValid

func (a *Attachment) IsValid() bool

type Author

type Author struct {
	Name   *string `json:"name"`
	Url    *string `json:"url"`
	Avatar *string `json:"avatar"`
}

func (*Author) IsValid

func (a *Author) IsValid() bool

type Feed

type Feed struct {
	Version     string   `json:"version"`
	Title       string   `json:"title"`
	HomePageUrl *string  `json:"home_page_url"`
	FeedUrl     *string  `json:"feed_url"`
	Description *string  `json:"Description"`
	UserComment *string  `json:"user_comment"`
	NextUrl     *string  `json:"next_url"`
	Icon        *string  `json:"icon"`
	Favicon     *string  `json:"favicon"`
	Language    *string  `json:"language"`
	Expired     *bool    `json:"expired"`
	Authors     []Author `json:"authors,omitempty"`
	Hubs        []Hub    `json:"hubs,omitempty"`
	Items       []Item   `json:"items,omitempty"`
}

func (Feed) IsEmpty added in v0.2.0

func (f Feed) IsEmpty() bool

func (Feed) IsValid

func (f Feed) IsValid() bool

type FeedConstraint added in v0.3.0

type FeedConstraint interface {
	IsEmpty() bool
}

type Hub

type Hub struct {
	Type string `json:"type"`
	Url  string `json:"url"`
}

func (*Hub) IsValid

func (h *Hub) IsValid() bool

type Item

type Item struct {
	Id            string       `json:"id"`
	Url           *string      `json:"url"`
	ExternalUrl   *string      `json:"external_url"`
	Title         *string      `json:"title"`
	ContentHtml   *string      `json:"content_html"`
	ContentText   *string      `json:"content_text"`
	Summary       *string      `json:"summary"`
	Image         *string      `json:"image"`
	BannerImage   *string      `json:"banner_image"`
	DatePublished *time.Time   `json:"date_published"`
	DateModified  *time.Time   `json:"date_modified"`
	Language      *string      `json:"language"`
	Authors       []Author     `json:"authors,omitempty"`
	Tags          []string     `json:"tags,omitempty"`
	Attachments   []Attachment `json:"attachments,omitempty"`
}

func (*Item) IsValid

func (i *Item) IsValid() bool

Jump to

Keyboard shortcuts

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