Documentation ¶
Index ¶
- Constants
- func NewService(db *gorm.DB, httpClient Doer, slackAppConfig domain.SlackApp, ...) (domain.CodeExchangeService, error)
- type AccessToken
- type CodeExchangeHTTPResponse
- type Doer
- type DoerMock
- type ExchangeRepository
- type Exchanger
- type MockExchangeRepository
- type MockExchanger
- type Repository
- type Service
- type SlackClient
Constants ¶
View Source
const OAuthServerEndpoint = "https://slack.com/api/oauth.v2.access"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccessToken ¶
type ExchangeRepository ¶
type Exchanger ¶
type Exchanger interface {
Exchange(string, string, string) (CodeExchangeHTTPResponse, error)
}
type MockExchangeRepository ¶
MockExchangeRepository is an autogenerated mock type for the MockExchangeRepository type
func (*MockExchangeRepository) Get ¶
func (_m *MockExchangeRepository) Get(_a0 string) (string, error)
Get provides a mock function with given fields: _a0
func (*MockExchangeRepository) Migrate ¶
func (_m *MockExchangeRepository) Migrate() error
Migrate provides a mock function with given fields:
func (*MockExchangeRepository) Upsert ¶
func (_m *MockExchangeRepository) Upsert(_a0 *AccessToken) error
Upsert provides a mock function with given fields: _a0
type MockExchanger ¶
MockExchanger is an autogenerated mock type for the Exchanger type
func (*MockExchanger) Exchange ¶
func (_m *MockExchanger) Exchange(_a0 string, _a1 string, _a2 string) (CodeExchangeHTTPResponse, error)
Exchange provides a mock function with given fields: _a0, _a1, _a2
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository talks to the store to read or insert data
func NewRepository ¶
func NewRepository(db *gorm.DB, encryptionKey string) (*Repository, error)
NewRepository returns repository struct
func (Repository) Migrate ¶
func (r Repository) Migrate() error
func (Repository) Upsert ¶
func (r Repository) Upsert(accessToken *AccessToken) error
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles business logic
func (Service) Exchange ¶
func (service Service) Exchange(payload domain.OAuthPayload) (*domain.OAuthExchangeResponse, error)
type SlackClient ¶
type SlackClient struct {
// contains filtered or unexported fields
}
func NewSlackClient ¶
func NewSlackClient(doer Doer) *SlackClient
func (*SlackClient) Exchange ¶
func (c *SlackClient) Exchange(code, clientID, clientSecret string) (CodeExchangeHTTPResponse, error)
Click to show internal directories.
Click to hide internal directories.