Documentation
¶
Index ¶
- Constants
- func DefaultRetryTimeout() time.Duration
- func Provider() *schema.Provider
- func WithRetry(ctx context.Context, config *RetryConfig, operation func() error) error
- func WithRetryWithResult[T any](ctx context.Context, config *RetryConfig, operation func() (T, error)) (T, error)
- type ClientInterface
- type ClientWrapper
- func (w *ClientWrapper) ArchiveConversationContext(ctx context.Context, channelID string) error
- func (w *ClientWrapper) AuthTest() (*slack.AuthTestResponse, error)
- func (w *ClientWrapper) CreateConversationContext(ctx context.Context, params slack.CreateConversationParams) (*slack.Channel, error)
- func (w *ClientWrapper) CreateUserGroupContext(ctx context.Context, userGroup slack.UserGroup, ...) (slack.UserGroup, error)
- func (w *ClientWrapper) DisableUserGroupContext(ctx context.Context, userGroup string, options ...slack.DisableUserGroupOption) (slack.UserGroup, error)
- func (w *ClientWrapper) EnableUserGroupContext(ctx context.Context, userGroup string, options ...slack.EnableUserGroupOption) (slack.UserGroup, error)
- func (w *ClientWrapper) GetConversationInfoContext(ctx context.Context, input *slack.GetConversationInfoInput) (*slack.Channel, error)
- func (w *ClientWrapper) GetConversationsContext(ctx context.Context, params *slack.GetConversationsParameters) ([]slack.Channel, string, error)
- func (w *ClientWrapper) GetUserByEmailContext(ctx context.Context, email string) (*slack.User, error)
- func (w *ClientWrapper) GetUserGroupsContext(ctx context.Context, options ...slack.GetUserGroupsOption) ([]slack.UserGroup, error)
- func (w *ClientWrapper) GetUsersContext(ctx context.Context) ([]slack.User, error)
- func (w *ClientWrapper) GetUsersInConversationContext(ctx context.Context, params *slack.GetUsersInConversationParameters) ([]string, string, error)
- func (w *ClientWrapper) InviteUsersToConversationContext(ctx context.Context, channelID string, users ...string) (*slack.Channel, error)
- func (w *ClientWrapper) JoinConversationContext(ctx context.Context, channelID string) (*slack.Channel, string, []string, error)
- func (w *ClientWrapper) KickUserFromConversationContext(ctx context.Context, channelID, user string) error
- func (w *ClientWrapper) RenameConversationContext(ctx context.Context, channelID, name string) (*slack.Channel, error)
- func (w *ClientWrapper) SetPurposeOfConversationContext(ctx context.Context, channelID, purpose string) (*slack.Channel, error)
- func (w *ClientWrapper) SetTopicOfConversationContext(ctx context.Context, channelID, topic string) (*slack.Channel, error)
- func (w *ClientWrapper) UnArchiveConversationContext(ctx context.Context, channelID string) error
- func (w *ClientWrapper) UpdateUserGroupContext(ctx context.Context, userGroupID string, ...) (slack.UserGroup, error)
- func (w *ClientWrapper) UpdateUserGroupMembersContext(ctx context.Context, userGroupID, users string) (slack.UserGroup, error)
- type MockSlackClient
- func (m *MockSlackClient) ArchiveConversationContext(ctx context.Context, channelID string) error
- func (m *MockSlackClient) AuthTest() (*slack.AuthTestResponse, error)
- func (m *MockSlackClient) CreateConversationContext(ctx context.Context, params slack.CreateConversationParams) (*slack.Channel, error)
- func (m *MockSlackClient) CreateUserGroupContext(ctx context.Context, userGroup slack.UserGroup, ...) (slack.UserGroup, error)
- func (m *MockSlackClient) DisableUserGroupContext(ctx context.Context, userGroup string, options ...slack.DisableUserGroupOption) (slack.UserGroup, error)
- func (m *MockSlackClient) EnableUserGroupContext(ctx context.Context, userGroup string, options ...slack.EnableUserGroupOption) (slack.UserGroup, error)
- func (m *MockSlackClient) GetConversationInfoContext(ctx context.Context, input *slack.GetConversationInfoInput) (*slack.Channel, error)
- func (m *MockSlackClient) GetConversationsContext(ctx context.Context, params *slack.GetConversationsParameters) ([]slack.Channel, string, error)
- func (m *MockSlackClient) GetUserByEmailContext(ctx context.Context, email string) (*slack.User, error)
- func (m *MockSlackClient) GetUserGroupsContext(ctx context.Context, options ...slack.GetUserGroupsOption) ([]slack.UserGroup, error)
- func (m *MockSlackClient) GetUsersContext(ctx context.Context) ([]slack.User, error)
- func (m *MockSlackClient) GetUsersInConversationContext(ctx context.Context, params *slack.GetUsersInConversationParameters) ([]string, string, error)
- func (m *MockSlackClient) InviteUsersToConversationContext(ctx context.Context, channelID string, users ...string) (*slack.Channel, error)
- func (m *MockSlackClient) JoinConversationContext(ctx context.Context, channelID string) (*slack.Channel, string, []string, error)
- func (m *MockSlackClient) KickUserFromConversationContext(ctx context.Context, channelID, user string) error
- func (m *MockSlackClient) RenameConversationContext(ctx context.Context, channelID, name string) (*slack.Channel, error)
- func (m *MockSlackClient) SetPurposeOfConversationContext(ctx context.Context, channelID, purpose string) (*slack.Channel, error)
- func (m *MockSlackClient) SetTopicOfConversationContext(ctx context.Context, channelID, topic string) (*slack.Channel, error)
- func (m *MockSlackClient) UnArchiveConversationContext(ctx context.Context, channelID string) error
- func (m *MockSlackClient) UpdateUserGroupContext(ctx context.Context, userGroupID string, ...) (slack.UserGroup, error)
- func (m *MockSlackClient) UpdateUserGroupMembersContext(ctx context.Context, userGroupID, users string) (slack.UserGroup, error)
- type ProviderConfig
- type RetryConfig
Constants ¶
const (
// DefaultRetryTimeoutSeconds is the default retry timeout in seconds
DefaultRetryTimeoutSeconds = 60
)
Variables ¶
This section is empty.
Functions ¶
func DefaultRetryTimeout ¶ added in v1.4.0
DefaultRetryTimeout returns the default retry timeout as a duration
func WithRetry ¶ added in v1.4.0
func WithRetry(ctx context.Context, config *RetryConfig, operation func() error) error
WithRetry executes a function with retry logic for rate limiting and other transient errors
func WithRetryWithResult ¶ added in v1.4.0
func WithRetryWithResult[T any](ctx context.Context, config *RetryConfig, operation func() (T, error)) (T, error)
WithRetryWithResult executes a function with retry logic and returns a result
Types ¶
type ClientInterface ¶ added in v1.4.1
type ClientInterface interface {
// User operations
GetUserByEmailContext(ctx context.Context, email string) (*slack.User, error)
GetUsersContext(ctx context.Context) ([]slack.User, error)
// Conversation operations
CreateConversationContext(ctx context.Context, params slack.CreateConversationParams) (*slack.Channel, error)
GetConversationInfoContext(ctx context.Context, input *slack.GetConversationInfoInput) (*slack.Channel, error)
GetConversationsContext(ctx context.Context, params *slack.GetConversationsParameters) ([]slack.Channel, string, error)
GetUsersInConversationContext(ctx context.Context, params *slack.GetUsersInConversationParameters) ([]string, string, error)
JoinConversationContext(ctx context.Context, channelID string) (*slack.Channel, string, []string, error)
InviteUsersToConversationContext(ctx context.Context, channelID string, users ...string) (*slack.Channel, error)
KickUserFromConversationContext(ctx context.Context, channelID, user string) error
SetTopicOfConversationContext(ctx context.Context, channelID, topic string) (*slack.Channel, error)
SetPurposeOfConversationContext(ctx context.Context, channelID, purpose string) (*slack.Channel, error)
RenameConversationContext(ctx context.Context, channelID, name string) (*slack.Channel, error)
ArchiveConversationContext(ctx context.Context, channelID string) error
UnArchiveConversationContext(ctx context.Context, channelID string) error
// User group operations
CreateUserGroupContext(ctx context.Context, userGroup slack.UserGroup, options ...slack.CreateUserGroupOption) (slack.UserGroup, error)
GetUserGroupsContext(ctx context.Context, options ...slack.GetUserGroupsOption) ([]slack.UserGroup, error)
UpdateUserGroupContext(ctx context.Context, userGroupID string, options ...slack.UpdateUserGroupsOption) (slack.UserGroup, error)
UpdateUserGroupMembersContext(ctx context.Context, userGroupID, users string) (slack.UserGroup, error)
DisableUserGroupContext(ctx context.Context, userGroup string, options ...slack.DisableUserGroupOption) (slack.UserGroup, error)
EnableUserGroupContext(ctx context.Context, userGroup string, options ...slack.EnableUserGroupOption) (slack.UserGroup, error)
// Auth operations
AuthTest() (*slack.AuthTestResponse, error)
}
ClientInterface defines the interface for Slack client operations This allows for easier mocking in unit tests
func NewClientWrapper ¶ added in v1.4.1
func NewClientWrapper(client *slack.Client) ClientInterface
NewClientWrapper creates a new wrapper around a slack.Client
type ClientWrapper ¶ added in v1.4.1
type ClientWrapper struct {
// contains filtered or unexported fields
}
ClientWrapper wraps the real slack.Client to implement ClientInterface
func (*ClientWrapper) ArchiveConversationContext ¶ added in v1.4.1
func (w *ClientWrapper) ArchiveConversationContext(ctx context.Context, channelID string) error
func (*ClientWrapper) AuthTest ¶ added in v1.4.1
func (w *ClientWrapper) AuthTest() (*slack.AuthTestResponse, error)
Auth operations
func (*ClientWrapper) CreateConversationContext ¶ added in v1.4.1
func (w *ClientWrapper) CreateConversationContext(ctx context.Context, params slack.CreateConversationParams) (*slack.Channel, error)
Conversation operations
func (*ClientWrapper) CreateUserGroupContext ¶ added in v1.4.1
func (w *ClientWrapper) CreateUserGroupContext(ctx context.Context, userGroup slack.UserGroup, options ...slack.CreateUserGroupOption) (slack.UserGroup, error)
User group operations
func (*ClientWrapper) DisableUserGroupContext ¶ added in v1.4.1
func (w *ClientWrapper) DisableUserGroupContext(ctx context.Context, userGroup string, options ...slack.DisableUserGroupOption) (slack.UserGroup, error)
func (*ClientWrapper) EnableUserGroupContext ¶ added in v1.4.1
func (w *ClientWrapper) EnableUserGroupContext(ctx context.Context, userGroup string, options ...slack.EnableUserGroupOption) (slack.UserGroup, error)
func (*ClientWrapper) GetConversationInfoContext ¶ added in v1.4.1
func (w *ClientWrapper) GetConversationInfoContext(ctx context.Context, input *slack.GetConversationInfoInput) (*slack.Channel, error)
func (*ClientWrapper) GetConversationsContext ¶ added in v1.4.1
func (w *ClientWrapper) GetConversationsContext(ctx context.Context, params *slack.GetConversationsParameters) ([]slack.Channel, string, error)
func (*ClientWrapper) GetUserByEmailContext ¶ added in v1.4.1
func (w *ClientWrapper) GetUserByEmailContext(ctx context.Context, email string) (*slack.User, error)
User operations
func (*ClientWrapper) GetUserGroupsContext ¶ added in v1.4.1
func (w *ClientWrapper) GetUserGroupsContext(ctx context.Context, options ...slack.GetUserGroupsOption) ([]slack.UserGroup, error)
func (*ClientWrapper) GetUsersContext ¶ added in v1.4.1
func (*ClientWrapper) GetUsersInConversationContext ¶ added in v1.4.1
func (w *ClientWrapper) GetUsersInConversationContext(ctx context.Context, params *slack.GetUsersInConversationParameters) ([]string, string, error)
func (*ClientWrapper) InviteUsersToConversationContext ¶ added in v1.4.1
func (*ClientWrapper) JoinConversationContext ¶ added in v1.4.1
func (*ClientWrapper) KickUserFromConversationContext ¶ added in v1.4.1
func (w *ClientWrapper) KickUserFromConversationContext(ctx context.Context, channelID, user string) error
func (*ClientWrapper) RenameConversationContext ¶ added in v1.4.1
func (*ClientWrapper) SetPurposeOfConversationContext ¶ added in v1.4.1
func (*ClientWrapper) SetTopicOfConversationContext ¶ added in v1.4.1
func (*ClientWrapper) UnArchiveConversationContext ¶ added in v1.4.1
func (w *ClientWrapper) UnArchiveConversationContext(ctx context.Context, channelID string) error
func (*ClientWrapper) UpdateUserGroupContext ¶ added in v1.4.1
func (w *ClientWrapper) UpdateUserGroupContext(ctx context.Context, userGroupID string, options ...slack.UpdateUserGroupsOption) (slack.UserGroup, error)
func (*ClientWrapper) UpdateUserGroupMembersContext ¶ added in v1.4.1
type MockSlackClient ¶ added in v1.4.1
type MockSlackClient struct {
// User mocks
MockGetUserByEmail func(ctx context.Context, email string) (*slack.User, error)
MockGetUsers func(ctx context.Context) ([]slack.User, error)
// Conversation mocks
MockCreateConversation func(ctx context.Context, params slack.CreateConversationParams) (*slack.Channel, error)
MockGetConversationInfo func(ctx context.Context, input *slack.GetConversationInfoInput) (*slack.Channel, error)
MockGetConversations func(ctx context.Context, params *slack.GetConversationsParameters) ([]slack.Channel, string, error)
MockGetUsersInConversation func(ctx context.Context, params *slack.GetUsersInConversationParameters) ([]string, string, error)
MockJoinConversation func(ctx context.Context, channelID string) (*slack.Channel, string, []string, error)
MockInviteUsersToConversation func(ctx context.Context, channelID string, users ...string) (*slack.Channel, error)
MockKickUserFromConversation func(ctx context.Context, channelID, user string) error
MockSetTopicOfConversation func(ctx context.Context, channelID, topic string) (*slack.Channel, error)
MockSetPurposeOfConversation func(ctx context.Context, channelID, purpose string) (*slack.Channel, error)
MockRenameConversation func(ctx context.Context, channelID, name string) (*slack.Channel, error)
MockArchiveConversation func(ctx context.Context, channelID string) error
MockUnArchiveConversation func(ctx context.Context, channelID string) error
// User group mocks
MockCreateUserGroup func(ctx context.Context, userGroup slack.UserGroup, options ...slack.CreateUserGroupOption) (slack.UserGroup, error)
MockGetUserGroups func(ctx context.Context, options ...slack.GetUserGroupsOption) ([]slack.UserGroup, error)
MockUpdateUserGroup func(ctx context.Context, userGroupID string, options ...slack.UpdateUserGroupsOption) (slack.UserGroup, error)
MockUpdateUserGroupMembers func(ctx context.Context, userGroupID, users string) (slack.UserGroup, error)
MockDisableUserGroup func(ctx context.Context, userGroup string, options ...slack.DisableUserGroupOption) (slack.UserGroup, error)
MockEnableUserGroup func(ctx context.Context, userGroup string, options ...slack.EnableUserGroupOption) (slack.UserGroup, error)
// Auth mocks
MockAuthTest func() (*slack.AuthTestResponse, error)
}
MockSlackClient is a mock implementation of ClientInterface for testing
func (*MockSlackClient) ArchiveConversationContext ¶ added in v1.4.1
func (m *MockSlackClient) ArchiveConversationContext(ctx context.Context, channelID string) error
func (*MockSlackClient) AuthTest ¶ added in v1.4.1
func (m *MockSlackClient) AuthTest() (*slack.AuthTestResponse, error)
Auth operations
func (*MockSlackClient) CreateConversationContext ¶ added in v1.4.1
func (m *MockSlackClient) CreateConversationContext(ctx context.Context, params slack.CreateConversationParams) (*slack.Channel, error)
Conversation operations
func (*MockSlackClient) CreateUserGroupContext ¶ added in v1.4.1
func (m *MockSlackClient) CreateUserGroupContext(ctx context.Context, userGroup slack.UserGroup, options ...slack.CreateUserGroupOption) (slack.UserGroup, error)
User group operations
func (*MockSlackClient) DisableUserGroupContext ¶ added in v1.4.1
func (m *MockSlackClient) DisableUserGroupContext(ctx context.Context, userGroup string, options ...slack.DisableUserGroupOption) (slack.UserGroup, error)
func (*MockSlackClient) EnableUserGroupContext ¶ added in v1.4.1
func (m *MockSlackClient) EnableUserGroupContext(ctx context.Context, userGroup string, options ...slack.EnableUserGroupOption) (slack.UserGroup, error)
func (*MockSlackClient) GetConversationInfoContext ¶ added in v1.4.1
func (m *MockSlackClient) GetConversationInfoContext(ctx context.Context, input *slack.GetConversationInfoInput) (*slack.Channel, error)
func (*MockSlackClient) GetConversationsContext ¶ added in v1.4.1
func (m *MockSlackClient) GetConversationsContext(ctx context.Context, params *slack.GetConversationsParameters) ([]slack.Channel, string, error)
func (*MockSlackClient) GetUserByEmailContext ¶ added in v1.4.1
func (m *MockSlackClient) GetUserByEmailContext(ctx context.Context, email string) (*slack.User, error)
User operations
func (*MockSlackClient) GetUserGroupsContext ¶ added in v1.4.1
func (m *MockSlackClient) GetUserGroupsContext(ctx context.Context, options ...slack.GetUserGroupsOption) ([]slack.UserGroup, error)
func (*MockSlackClient) GetUsersContext ¶ added in v1.4.1
func (*MockSlackClient) GetUsersInConversationContext ¶ added in v1.4.1
func (m *MockSlackClient) GetUsersInConversationContext(ctx context.Context, params *slack.GetUsersInConversationParameters) ([]string, string, error)
func (*MockSlackClient) InviteUsersToConversationContext ¶ added in v1.4.1
func (*MockSlackClient) JoinConversationContext ¶ added in v1.4.1
func (*MockSlackClient) KickUserFromConversationContext ¶ added in v1.4.1
func (m *MockSlackClient) KickUserFromConversationContext(ctx context.Context, channelID, user string) error
func (*MockSlackClient) RenameConversationContext ¶ added in v1.4.1
func (*MockSlackClient) SetPurposeOfConversationContext ¶ added in v1.4.1
func (*MockSlackClient) SetTopicOfConversationContext ¶ added in v1.4.1
func (*MockSlackClient) UnArchiveConversationContext ¶ added in v1.4.1
func (m *MockSlackClient) UnArchiveConversationContext(ctx context.Context, channelID string) error
func (*MockSlackClient) UpdateUserGroupContext ¶ added in v1.4.1
func (m *MockSlackClient) UpdateUserGroupContext(ctx context.Context, userGroupID string, options ...slack.UpdateUserGroupsOption) (slack.UserGroup, error)
func (*MockSlackClient) UpdateUserGroupMembersContext ¶ added in v1.4.1
type ProviderConfig ¶ added in v1.4.0
type ProviderConfig struct {
Client ClientInterface
RetryConfig *RetryConfig
}
ProviderConfig holds the provider configuration
type RetryConfig ¶ added in v1.4.0
RetryConfig holds the retry configuration for the provider
func DefaultRetryConfig ¶ added in v1.4.0
func DefaultRetryConfig() *RetryConfig
DefaultRetryConfig returns the default retry configuration