Documentation
¶
Index ¶
- type InstagramSource
- func (s *InstagramSource) Ack(ctx context.Context, msg hermod.Message) error
- func (s *InstagramSource) Close() error
- func (s *InstagramSource) GetState() map[string]string
- func (s *InstagramSource) Ping(ctx context.Context) error
- func (s *InstagramSource) Read(ctx context.Context) (hermod.Message, error)
- func (s *InstagramSource) SetBaseURL(u string)
- func (s *InstagramSource) SetState(state map[string]string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InstagramSource ¶
type InstagramSource struct {
// contains filtered or unexported fields
}
InstagramSource implements the hermod.Source interface for polling Instagram media.
func NewInstagramSource ¶
func NewInstagramSource(accessToken, igUserID string, interval time.Duration, mode string) *InstagramSource
NewInstagramSource creates a new InstagramSource.
func (*InstagramSource) Close ¶
func (s *InstagramSource) Close() error
Close closes the Instagram source.
func (*InstagramSource) GetState ¶
func (s *InstagramSource) GetState() map[string]string
GetState returns the current state of the source.
func (*InstagramSource) Ping ¶
func (s *InstagramSource) Ping(ctx context.Context) error
Ping checks the connection to Instagram.
func (*InstagramSource) SetBaseURL ¶
func (s *InstagramSource) 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 (*InstagramSource) SetState ¶
func (s *InstagramSource) SetState(state map[string]string)
SetState sets the current state of the source.