go-barefeed – git.sr.ht/~chrisppy/go-barefeed Index | Files

package barefeed

import "git.sr.ht/~chrisppy/go-barefeed"

Package barefeed is an implementation of the barefeed message format for Go.

https://git.sr.ht/~chrisppy/go-barefeed

Index

Types

type Bin

type Bin struct {
	Generator string  `bare:"generator"`
	Content   Content `bare:"content"`
}

func (*Bin) Decode

func (t *Bin) Decode(data []byte) error

func (*Bin) Encode

func (t *Bin) Encode() ([]byte, error)

func (Bin) Write

func (d Bin) Write(writer io.Writer) error

Write will output the Bin to the provided io writer

type Content

type Content interface {
	bare.Union
}

type Entry

type Entry struct {
	FeedID    string   `bare:"feedID"`
	EntryID   string   `bare:"entryID"`
	Read      bool     `bare:"read"`
	Liked     bool     `bare:"liked"`
	Position  uint     `bare:"position"`
	Title     Text     `bare:"title"`
	Content   Text     `bare:"content"`
	Updated   Time     `bare:"updated"`
	Published *Time    `bare:"published"`
	Authors   []Person `bare:"authors"`
	Links     []Link   `bare:"links"`
}

func (*Entry) Decode

func (t *Entry) Decode(data []byte) error

func (*Entry) Encode

func (t *Entry) Encode() ([]byte, error)

func (Entry) IsUnion

func (_ Entry) IsUnion()

type Feed

type Feed struct {
	FeedPath string   `bare:"feedPath"`
	FeedID   string   `bare:"feedID"`
	Title    Text     `bare:"title"`
	Updated  Time     `bare:"updated"`
	Authors  []Person `bare:"authors"`
	Links    []Link   `bare:"links"`
}

func (*Feed) Decode

func (t *Feed) Decode(data []byte) error

func (*Feed) Encode

func (t *Feed) Encode() ([]byte, error)

func (Feed) IsUnion

func (_ Feed) IsUnion()

type FeedMap

type FeedMap map[string]Linked

FeedMap map of Linked

func (FeedMap) Read

func (d FeedMap) Read(reader io.Reader) (err error)

Read will open the provided reader and load it into the FeedEntry

type Link struct {
	Href     string  `bare:"href"`
	Rel      *string `bare:"rel"`
	LinkType *string `bare:"linkType"`
	Lang     *string `bare:"lang"`
	Title    *string `bare:"title"`
	Length   *string `bare:"length"`
}

func (*Link) Decode

func (t *Link) Decode(data []byte) error

func (*Link) Encode

func (t *Link) Encode() ([]byte, error)

type Linked

type Linked struct {
	Feed    Feed
	Entries map[string]Entry
}

Linked containing the linkage between a Feed and Entry

type Person

type Person struct {
	Name  string  `bare:"name"`
	Email *string `bare:"email"`
	Uri   *string `bare:"uri"`
}

func (*Person) Decode

func (t *Person) Decode(data []byte) error

func (*Person) Encode

func (t *Person) Encode() ([]byte, error)

type Text

type Text struct {
	TextType string `bare:"textType"`
	Value    string `bare:"value"`
}

func (*Text) Decode

func (t *Text) Decode(data []byte) error

func (*Text) Encode

func (t *Text) Encode() ([]byte, error)

type Time

type Time string

func (*Time) Decode

func (t *Time) Decode(data []byte) error

func (*Time) Encode

func (t *Time) Encode() ([]byte, error)

Source Files

barefeed.go schema.go

Version
v0.6.0 (latest)
Published
Oct 16, 2021
Platform
linux/amd64
Imports
3 packages
Last checked
2 weeks ago

Tools for package owners.