sources

package
v0.0.0-...-06a3cf6 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2025 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSource

func NewSource(sourceType string) (sourcestypes.Source, error)

func NewTypedUID

func NewTypedUID(uid string) (types.TypedUID, error)

Types

type CachedRegistry

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

CachedRegistry wraps a SourceRegistry and adds caching functionality

func NewCachedRegistry

func NewCachedRegistry(registry *Registry, logger *zerolog.Logger) *CachedRegistry

func (*CachedRegistry) FindByUID

FindByUID finds a source by UID with caching

func (*CachedRegistry) Initialize

func (c *CachedRegistry) Initialize() error

func (*CachedRegistry) Search

func (c *CachedRegistry) Search(ctx context.Context, params SearchRequest) ([]types.Source, error)

Search searches for sources with caching

type Config

type Config struct {
	MaxActivityProcessorConcurrency int `env:"MAX_ACTIVITY_PROCESSOR_CONCURRENCY,default=10"`
}

type ListRequest

type ListRequest struct {
	SourceUIDs []activitytypes.TypedUID
}

type Registry

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

Registry manages available source configurations through fetchers.

func NewRegistry

func NewRegistry(logger *zerolog.Logger, sourceConfig *types.ProviderConfig) *Registry

func (*Registry) FindByUID

func (r *Registry) FindByUID(ctx context.Context, uid activitytypes.TypedUID) (types.Source, error)

func (*Registry) Initialize

func (r *Registry) Initialize() error

Initialize sets up the fetchers for each source type

func (*Registry) Search

func (r *Registry) Search(ctx context.Context, params SearchRequest) ([]types.Source, error)

Search searches for sources from available fetchers

type Scheduler

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

Scheduler manages the execution of active sources.

It is responsible for: - Initializing sources - Managing the lifecycle of polling sources - Scheduling the processing of activities

func NewScheduler

func NewScheduler(
	logger *zerolog.Logger,
	sourceRepo sourceStore,
	activityRegistry *activities.Registry,
	config *Config,
	sourceConfig *sourcetypes.ProviderConfig,
) *Scheduler

func (*Scheduler) Add

func (r *Scheduler) Add(source sourcetypes.Source) error

Add starts processing activities from the source.

func (*Scheduler) Initialize

func (r *Scheduler) Initialize(ctx context.Context) error

func (*Scheduler) List

func (r *Scheduler) List(req ListRequest) ([]sourcetypes.Source, error)

func (*Scheduler) Remove

func (r *Scheduler) Remove(uid string) error

Remove stops the source execution

func (*Scheduler) Shutdown

func (r *Scheduler) Shutdown()

type SearchRequest

type SearchRequest struct {
	Query  string
	Topics []types.TopicTag
}

SearchRequest configures how sources are searched and ranked.

Directories

Path Synopsis
rss

Jump to

Keyboard shortcuts

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