synchronizing

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FeedFetchMetadata

type FeedFetchMetadata struct {
	UUID string

	ETag         string
	LastModified time.Time

	UpdatedAt time.Time
	FetchedAt time.Time
}

type FeedMetadata added in v0.3.0

type FeedMetadata struct {
	UUID string

	Title       string
	Description string

	Hash uint64

	UpdatedAt time.Time
}

type Repository

type Repository interface {
	// FeedGetNByLastSynchronizationTime returns at most n feeds that have last been synchronized before
	// a given time.Time.
	//
	// This method must return only feeds with at least one active user Subscription.
	FeedGetNByLastSynchronizationTime(n uint, before time.Time) ([]feed.Feed, error)

	// FeedUpdateFetchMetadata updates fetch metadata (ETag, FetchedAt, UpdatedAt) for a given feed.Feed.
	FeedUpdateFetchMetadata(feedFetchMetadata FeedFetchMetadata) error

	// FeedUpdateMetadata updates metadata (Title, Description) for a given feed.Feed.
	FeedUpdateMetadata(feedMetadata FeedMetadata) error

	// FeedEntryUpsertMany adds a collection of new entries and updates existing entries.
	FeedEntryUpsertMany(entries []feed.Entry) (int64, error)
}

type Scheduler

type Scheduler struct {
	// contains filtered or unexported fields
}

A Scheduler periodically synchronizes all syndication feeds.

func NewScheduler

func NewScheduler(service *Service, locker sync.Locker) *Scheduler

NewScheduler initializes and returns a Scheduler.

func (*Scheduler) Run

func (sc *Scheduler) Run()

Run periodically synchronizes all syndication feeds.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service handles feed synchronization operations.

func NewService

func NewService(r Repository, client *fetching.Client) *Service

func (*Service) Synchronize

func (s *Service) Synchronize(jobID string) error

Synchronize synchronizes syndication feeds for all users.

Jump to

Keyboard shortcuts

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