app

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigApp

type ConfigApp struct {
	BrandingDisabled bool   `toml:"branding_disabled"`
	DBPath           string `toml:"db_path"`
	LogLevel         string `toml:"loglevel"`
	Oldest           int    `toml:"oldest"`
	Ticker           int    `toml:"ticker"`
	Timeout          int    `toml:"timeout"`
}

func (ConfigApp) LoggerLevel

func (ca ConfigApp) LoggerLevel() slog.Level

type ConfigFeed

type ConfigFeed struct {
	Name     string   `toml:"name"`
	URL      string   `toml:"url"`
	Webhooks []string `toml:"webhooks"`
	Disabled bool     `toml:"disabled"`
}

type ConfigWebhook

type ConfigWebhook struct {
	Name string `toml:"name"`
	URL  string `toml:"url"`
}

type FeedStats

type FeedStats struct {
	Name          string
	ErrorCount    int
	ReceivedCount int
	ReceivedLast  time.Time
}

type ItemState

type ItemState uint
const (
	StateProcessed ItemState = iota
	StateUpdated
	StateNew
)

type MyConfig

type MyConfig struct {
	App      ConfigApp
	Feeds    []ConfigFeed
	Webhooks []ConfigWebhook
}

func ReadConfig

func ReadConfig(path string) (MyConfig, error)

func (*MyConfig) EnabledFeeds

func (mc *MyConfig) EnabledFeeds() []ConfigFeed

type ProcessedItem

type ProcessedItem struct {
	ID        string
	Published time.Time
}

ProcessedItem represents a sent item

func NewProcessedItemFromBytes

func NewProcessedItemFromBytes(byt []byte) (*ProcessedItem, error)

func (*ProcessedItem) Key

func (si *ProcessedItem) Key() []byte

func (*ProcessedItem) ToBytes

func (si *ProcessedItem) ToBytes() ([]byte, error)

type WebhookStats

type WebhookStats struct {
	Name       string
	ErrorCount int
	SentCount  int
	SentLast   time.Time
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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