facebook

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 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 FacebookSource

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

FacebookSource implements the hermod.Source interface for polling Facebook Page feed.

func NewFacebookSource

func NewFacebookSource(accessToken, pageID string, interval time.Duration, mode string) *FacebookSource

NewFacebookSource creates a new FacebookSource.

func (*FacebookSource) Ack

func (s *FacebookSource) Ack(ctx context.Context, msg hermod.Message) error

Ack acknowledges a message.

func (*FacebookSource) Close

func (s *FacebookSource) Close() error

Close closes the Facebook source.

func (*FacebookSource) GetState

func (s *FacebookSource) GetState() map[string]string

GetState returns the current state of the source.

func (*FacebookSource) Ping

func (s *FacebookSource) Ping(ctx context.Context) error

Ping checks the connection to Facebook.

func (*FacebookSource) Read

Read reads the next post from Facebook.

func (*FacebookSource) SetBaseURL

func (s *FacebookSource) SetBaseURL(u string)

SetBaseURL overrides the vendor endpoint this connector talks to.

The hostname is hardcoded in the constructor, which made the connector impossible to exercise without dialling the live API -- so it sat outside the conformance suite, untested, while connectors that took an address were covered. This is the seam that closes that gap: point it at a test server or a dead address and the contract can be checked offline.

An empty string leaves the default in place, so a caller that has nothing to override does not have to special-case it.

func (*FacebookSource) SetState

func (s *FacebookSource) SetState(state map[string]string)

SetState sets the current state of the source.

Jump to

Keyboard shortcuts

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