aggregator

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregator

type Aggregator interface {
	// Start should start a goroutine that periodically fetches content from
	// Instagram and updates the local database accordingly.
	Start(interval time.Duration) error

	// Stop should stop the periodical update and free resources.
	Stop()
}

Aggregator defines the primitives required for an Aggregator. An aggregator's job is to periodically fetch new entries and store them on a database.

func NewInstagramAggregator added in v1.0.2

func NewInstagramAggregator(db *buntdb.DB, api instagram.InstagramAPI,
	imagesFolder string, client HTTPClient, logger zerolog.Logger) Aggregator

NewInstagramAggregator returns a new initialized instagram aggregator.

type HTTPClient added in v1.0.1

type HTTPClient interface {
	Get(url string) (resp *http.Response, err error)
}

HTTPClient defines the primitive needed to perform HTTP queries

type InstagramAggregator added in v1.0.2

type InstagramAggregator struct {
	sync.Mutex
	// contains filtered or unexported fields
}

InstagramAggregator implements an aggregator that fetches Instagram posts.

- implements aggregator.Aggregator

func (*InstagramAggregator) Start added in v1.0.2

func (a *InstagramAggregator) Start(interval time.Duration) error

Start implements aggregator.Aggregator. It should be called only if the aggregator is not already running.

func (*InstagramAggregator) Stop added in v1.0.2

func (a *InstagramAggregator) Stop()

Stop implements aggregator.Aggregator. It should be called only if the Aggregator is started.

Jump to

Keyboard shortcuts

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