anteater package - github.com/petspalace/anteater - Go Packages

anteater

package module
v0.0.0-...-85269f1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: MIT Imports: 6 Imported by: 0

README

anteater

Small Golang program to republish data from RSS and Atom feeds.

installation

container

This will start a long-running container with anteater in it which runs all available subcommands. The container is available for amd64 and aarch64.

podman run ghcr.io/petspalace/anteater:latest

The podman command can be switched out docker if you wish.

usage

todo

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Loop

func Loop(every time.Duration, state *State, c chan<- Item) error

func Poll

func Poll(state *State, c chan<- Item) error

Types

type Environment

type Environment struct {
	MqttHost     string
	MqttPrefix   string
	MqttTopic    string
	MqttTemplate string
}

func NewEnvironmentFromEnv

func NewEnvironmentFromEnv() (*Environment, error)

type Feed

type Feed struct {
	Nickname string
	URL      string
}

Describe a feed to follow, the URL refers to any feed type that the `gofeed` library understands. Generally RSS or Atom feeds.

func NewFeed

func NewFeed(nickname string, URL string) Feed

type Item

type Item struct {
	Feed *Feed
	URL  string
}

Describe an Item that was published on a Feed with its URL and the Feed it belongs to so we can then use the Feed metadata.

func NewItem

func NewItem(feed *Feed, URL string) Item

type State

type State struct {
	LastPolledAt time.Time
}

Describes the state of the running `anteater` instance in memory. Only keeps track of the last time we looked up any new Items on Feeds so we can tell which items are new.

func NewState

func NewState() (*State, error)

Directories

Path Synopsis
cmd
anteater command

Jump to

Keyboard shortcuts

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