slack

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interactor

type Interactor interface {
	FindUserByID(ctx context.Context, id int64) (*ent.User, error)

	FindChatUserByID(ctx context.Context, id string) (*ent.ChatUser, error)
	CreateChatUser(ctx context.Context, cu *ent.ChatUser) (*ent.ChatUser, error)
	UpdateChatUser(ctx context.Context, cu *ent.ChatUser) (*ent.ChatUser, error)
	DeleteChatUser(ctx context.Context, cu *ent.ChatUser) error

	FindDeploymentByID(ctx context.Context, id int) (*ent.Deployment, error)
	FindDeploymentStatusByID(ctx context.Context, id int) (*ent.DeploymentStatus, error)

	FindReviewByID(ctx context.Context, id int) (*ent.Review, error)

	SubscribeEvent(fn func(e *ent.Event)) error
	UnsubscribeEvent(fn func(e *ent.Event)) error
}

type Slack

type Slack struct {
	// contains filtered or unexported fields
}

func NewSlack

func NewSlack(c *SlackConfig) *Slack

func (*Slack) Index

func (s *Slack) Index(c *gin.Context)

func (*Slack) Notify

func (s *Slack) Notify(ctx context.Context, e *ent.Event)

func (*Slack) Signin

func (s *Slack) Signin(c *gin.Context)

Signin authenticate by Slack oAuth https://api.slack.com/authentication/oauth-v2#exchanging

func (*Slack) Signout

func (s *Slack) Signout(c *gin.Context)

type SlackAuthedUser

type SlackAuthedUser struct {
	ID          string `json:"id"`
	Scope       string `json:"scope"`
	AccessToken string `json:"access_token"`
}

type SlackConfig

type SlackConfig struct {
	ServerHost  string
	ServerProto string
	*oauth2.Config
	Interactor
}

type SlackTokenResponse

type SlackTokenResponse struct {
	// Bot access token
	AccessToken string `json:"access_token"`
	TokenType   string `json:"token_type"`
	Scope       string `json:"scope"`
	// Authenticated user access token.
	User *SlackAuthedUser `json:"authed_user"`
}

SlackTokenResponse is the result from exchanging a authorization code for user's access token in Slack. https://api.slack.com/authentication/oauth-v2#exchanging

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL