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