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