entity

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormatAtom = "atom"
	FormatRSS  = "rss"
)
View Source
const CacheTTLDefault = 60 // minutes

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	Username string
	Title    string
	URL      string
	ImageURL string
	Posts    []Post
}

type FeedParams

type FeedParams struct {
	// Username is the Telegram channel username
	Username string

	// Format is the feed format, either "atom" or "rss"
	Format string

	// ExcludeWords is a list of words that will exclude a post if matched
	ExcludeWords []string

	// ExcludeCaseSensitive determines if exclusion matching is case-sensitive
	ExcludeCaseSensitive bool

	// CacheTTL is the cache time-to-live in minutes
	// A value of 0 means no caching
	CacheTTL int
}

FeedParams represents validated request parameters for feed generation

func NewFeedParamFromRequest

func NewFeedParamFromRequest(r *http.Request) (*FeedParams, error)

NewFeedParamFromRequest parses and validates request parameters and creates a new FeedParams nolint: cyclop

type Image

type Image struct {
	URL  string
	Type string
	// In bytes
	Size int64
}

Image represents an image attachment with its metadata

type Post

type Post struct {
	// Post ID, e.g. 123
	ID          int
	URL         string
	Title       string
	ContentHTML string
	// True if this post contains only image(s) without text content
	ImageOnly bool
	// A preview image that goes to enclosure
	Preview *Image
	// Collection of all images in the post
	Images []Image
	// Date and time of the post in RFC3339 format.
	Datetime time.Time
}

Jump to

Keyboard shortcuts

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