Documentation
¶
Overview ¶
Package slack provides business logic for interacting with Slack, such as sending and receiving messages, and retrieving channel lists.
Index ¶
- type API
- type Client
- func (c *Client) AddPinContext(ctx context.Context, channel string, item slack.ItemRef) error
- func (c *Client) GetConversationsContext(ctx context.Context, params *slack.GetConversationsParameters) (channels []slack.Channel, nextCursor string, err error)
- func (c *Client) GetPermalinkContext(ctx context.Context, params *slack.PermalinkParameters) (string, error)
- func (c *Client) GetTeamInfoContext(ctx context.Context) (*slack.TeamInfo, error)
- func (c *Client) GetUserInfoContext(ctx context.Context, user string) (*slack.User, error)
- func (c *Client) GetUsersContext(ctx context.Context, options ...slack.GetUsersOption) ([]slack.User, error)
- func (c *Client) GetUsersInConversationContext(ctx context.Context, params *slack.GetUsersInConversationParameters) ([]string, string, error)
- func (c *Client) OpenViewContext(ctx context.Context, triggerID string, view slack.ModalViewRequest) (*slack.ViewResponse, error)
- func (c *Client) PostEphemeralContext(ctx context.Context, channelID, userID string, options ...slack.MsgOption) (timestamp string, err error)
- func (c *Client) PostMessageContext(ctx context.Context, channel string, options ...slack.MsgOption) (string, string, error)
- func (c *Client) PushViewContext(ctx context.Context, triggerID string, view slack.ModalViewRequest) (*slack.ViewResponse, error)
- func (c *Client) RemovePinContext(ctx context.Context, channel string, item slack.ItemRef) error
- func (c *Client) UpdateMessageContext(ctx context.Context, channelID, timestamp string, options ...slack.MsgOption) (string, string, string, error)
- func (c *Client) UpdateViewContext(ctx context.Context, view slack.ModalViewRequest, ...) (*slack.ViewResponse, error)
- type PostgresRepository
- func (r *PostgresRepository) CreateUser(ctx context.Context, user *models.User) (*models.User, error)
- func (r *PostgresRepository) DeleteUser(ctx context.Context, user *models.User) (*models.User, error)
- func (r *PostgresRepository) ExistsUserByID(ctx context.Context, id string) (bool, error)
- func (r *PostgresRepository) GetUserByID(ctx context.Context, id string) (*models.User, error)
- func (r *PostgresRepository) GetUserByName(ctx context.Context, name string) (*models.User, error)
- func (r *PostgresRepository) GetUserBySlackUserID(ctx context.Context, id int32) (*models.User, error)
- type Repository
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface {
AddPinContext(ctx context.Context, channel string, item slack.ItemRef) error
GetConversationsContext(ctx context.Context, params *slack.GetConversationsParameters) (channels []slack.Channel, nextCursor string, err error)
GetPermalinkContext(ctx context.Context, params *slack.PermalinkParameters) (string, error)
GetTeamInfoContext(ctx context.Context) (*slack.TeamInfo, error)
GetUserInfoContext(ctx context.Context, user string) (*slack.User, error)
GetUsersContext(ctx context.Context, options ...slack.GetUsersOption) ([]slack.User, error)
GetUsersInConversationContext(ctx context.Context, params *slack.GetUsersInConversationParameters) ([]string, string, error)
OpenViewContext(ctx context.Context, triggerID string, view slack.ModalViewRequest) (*slack.ViewResponse, error)
PostEphemeralContext(ctx context.Context, channelID, userID string, options ...slack.MsgOption) (timestamp string, err error)
PostMessageContext(ctx context.Context, channel string, options ...slack.MsgOption) (string, string, error)
PushViewContext(ctx context.Context, triggerID string, view slack.ModalViewRequest) (*slack.ViewResponse, error)
RemovePinContext(ctx context.Context, channel string, item slack.ItemRef) error
UpdateMessageContext(ctx context.Context, channelID string, timestamp string, options ...slack.MsgOption) (string, string, string, error)
UpdateViewContext(ctx context.Context, view slack.ModalViewRequest, externalID string, hash string, viewID string) (*slack.ViewResponse, error)
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddPinContext ¶
func (*Client) GetConversationsContext ¶
func (*Client) GetPermalinkContext ¶
func (*Client) GetTeamInfoContext ¶
func (*Client) GetUserInfoContext ¶
func (*Client) GetUsersContext ¶
func (*Client) GetUsersInConversationContext ¶
func (*Client) OpenViewContext ¶
func (c *Client) OpenViewContext(ctx context.Context, triggerID string, view slack.ModalViewRequest) (*slack.ViewResponse, error)
func (*Client) PostEphemeralContext ¶
func (*Client) PostMessageContext ¶
func (*Client) PushViewContext ¶
func (c *Client) PushViewContext(ctx context.Context, triggerID string, view slack.ModalViewRequest) (*slack.ViewResponse, error)
func (*Client) RemovePinContext ¶
func (*Client) UpdateMessageContext ¶
func (*Client) UpdateViewContext ¶
func (c *Client) UpdateViewContext(ctx context.Context, view slack.ModalViewRequest, externalID, hash, viewID string) (*slack.ViewResponse, error)
type PostgresRepository ¶
type PostgresRepository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(q sqlc.Querier) *PostgresRepository
func (*PostgresRepository) CreateUser ¶
func (r *PostgresRepository) CreateUser(ctx context.Context, user *models.User) (*models.User, error)
CreateUser creates a new Slack user in the database. This operation executes a single INSERT statement and does not require an explicit transaction.
func (*PostgresRepository) DeleteUser ¶
func (*PostgresRepository) ExistsUserByID ¶
func (*PostgresRepository) GetUserByID ¶
func (*PostgresRepository) GetUserByName ¶
func (*PostgresRepository) GetUserBySlackUserID ¶
type Repository ¶
type Repository interface {
CreateUser(ctx context.Context, user *models.User) (*models.User, error)
DeleteUser(ctx context.Context, user *models.User) (*models.User, error)
ExistsUserByID(ctx context.Context, id string) (bool, error)
GetUserByID(ctx context.Context, id string) (*models.User, error)
GetUserBySlackUserID(ctx context.Context, id int32) (*models.User, error)
}
type Service ¶
type Service interface {
AddPinContext(ctx context.Context, channel, timestamp string) error
CreateUser(ctx context.Context, user *models.User) (*models.User, error)
DeleteUser(ctx context.Context, user *models.User) (*models.User, error)
ExistsUserByID(ctx context.Context, id string) (bool, error)
ExistsUserInChannelByID(ctx context.Context, id string, channelID string) (bool, error)
FetchAllChannelsContext(ctx context.Context) ([]slack.Channel, error)
FetchReviewersChannelByRole(ctx context.Context, role string) ([]types.ReviewersChannel, error)
FetchTeamInfoContext(ctx context.Context) (*types.TeamInfo, error)
FetchUserInfoContext(ctx context.Context, user string) (*models.User, error)
FetchUsersContext(ctx context.Context) ([]models.User, error)
FetchUsersInConversationContext(ctx context.Context, channelID string) ([]string, error)
GetPermalinkContext(ctx context.Context, channel, timestamp string) (string, error)
GetUserByID(ctx context.Context, id string) (*models.User, error)
GetUserBySlackUserID(ctx context.Context, id int32) (*models.User, error)
OpenModalContext(ctx context.Context, triggerID string, builder modal.Builder) error
PostEphemeralContext(ctx context.Context, channelID, userID string, builder message.Builder) (timestamp string, err error)
PostMessageContext(ctx context.Context, channelID string, builder message.Builder) (string, string, error)
PushModalContext(ctx context.Context, triggerID string, builder modal.Builder) error
RemovePinContext(ctx context.Context, channel string, timestamp string) error
UpdateMessageContext(ctx context.Context, channel, timestamp string, builder message.Builder) (string, string, string, error)
UpdateModalContext(ctx context.Context, builder modal.Builder, externalID, hash, viewID string) error
}
func NewService ¶
func NewService(api API, repo Repository) Service
Click to show internal directories.
Click to hide internal directories.