Documentation ¶
Index ¶
- type ConcreteSlackClient
- func (c *ConcreteSlackClient) GetConversationHistory(params *slack.GetConversationHistoryParameters) (*slack.GetConversationHistoryResponse, error)
- func (c *ConcreteSlackClient) GetConversationRepliesContext(ctx context.Context, params *slack.GetConversationRepliesParameters) ([]slack.Message, bool, string, error)
- type DatasourceMock
- type Manager
- type SlackClient
- type SlackClientMock
- func (_m *SlackClientMock) GetConversationHistory(params *slack.GetConversationHistoryParameters) (*slack.GetConversationHistoryResponse, error)
- func (_m *SlackClientMock) GetConversationRepliesContext(ctx context.Context, params *slack.GetConversationRepliesParameters) ([]slack.Message, bool, string, error)
- type SlackDatasource
- type SlackDatasourceError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConcreteSlackClient ¶
type ConcreteSlackClient struct {
// contains filtered or unexported fields
}
ConcreteSlackClient is a concrete implementation of the Slack client interface
func NewConcreteSlackClient ¶
func NewConcreteSlackClient(token string) *ConcreteSlackClient
NewConcreteSlackClient creates a new Slack client with the given token
func (*ConcreteSlackClient) GetConversationHistory ¶
func (c *ConcreteSlackClient) GetConversationHistory(params *slack.GetConversationHistoryParameters) (*slack.GetConversationHistoryResponse, error)
GetConversationHistory is a wrapper around slack.GetConversationHistory
func (*ConcreteSlackClient) GetConversationRepliesContext ¶
func (c *ConcreteSlackClient) GetConversationRepliesContext(ctx context.Context, params *slack.GetConversationRepliesParameters) ([]slack.Message, bool, string, error)
GetConversationRepliesContext is a wrapper around slack.GetConversationRepliesContext
type DatasourceMock ¶
func (*DatasourceMock) GetID ¶
func (_m *DatasourceMock) GetID() string
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewDatasourceManager ¶
func (*Manager) RegisterRoutes ¶
func (dm *Manager) RegisterRoutes(r chi.Router)
type SlackClient ¶
type SlackClient interface { GetConversationHistory(params *slack.GetConversationHistoryParameters) (*slack.GetConversationHistoryResponse, error) GetConversationRepliesContext(ctx context.Context, params *slack.GetConversationRepliesParameters) (msgs []slack.Message, hasMore bool, nextCursor string, err error) }
SlackClient is an interface for a Slack client
type SlackClientMock ¶
func NewSlackClient ¶
func NewSlackClient(t interface { mock.TestingT Cleanup(func()) }) *SlackClientMock
func (*SlackClientMock) GetConversationHistory ¶
func (_m *SlackClientMock) GetConversationHistory(params *slack.GetConversationHistoryParameters) (*slack.GetConversationHistoryResponse, error)
func (*SlackClientMock) GetConversationRepliesContext ¶
func (_m *SlackClientMock) GetConversationRepliesContext(ctx context.Context, params *slack.GetConversationRepliesParameters) ([]slack.Message, bool, string, error)
type SlackDatasource ¶
type SlackDatasource struct {
// contains filtered or unexported fields
}
SlackDatasource is a datasource for fetching messages from a Slack channel
func NewSlackDatasource ¶
func NewSlackDatasource(config types.DatasourceConfig, client SlackClient, logger *logrus.Logger) (*SlackDatasource, error)
NewSlackDatasource creates a new Slack datasource with the given configuration, client, and logger
func (*SlackDatasource) GetData ¶
func (s *SlackDatasource) GetData(ctx context.Context, state types.DatasourceState) ([]types.Document, types.DatasourceState, error)
GetData fetches new messages from the Slack channel and returns them as documents
func (*SlackDatasource) GetID ¶
func (s *SlackDatasource) GetID() uuid.UUID
GetID returns the UUID of the Slack datasource
func (*SlackDatasource) Validate ¶
func (s *SlackDatasource) Validate() error
Validate validates the Slack datasource configuration
type SlackDatasourceError ¶
SlackDatasourceError is an error type for Slack datasource operations
func (*SlackDatasourceError) Error ¶
func (e *SlackDatasourceError) Error() string