Documentation ¶
Index ¶
- Constants
- func NewService(db *gorm.DB, httpClient Doer, encryptionKey string) (domain.ReceiverService, error)
- func NewSlackHelper(httpClient Doer, encryptionKey string) (*slackHelper, error)
- type Channel
- type CodeExchangeHTTPResponse
- type Doer
- type DoerMock
- type Exchanger
- type MockExchanger
- type MockReceiverRepository
- func (_m *MockReceiverRepository) Create(_a0 *Receiver) (*Receiver, error)
- func (_m *MockReceiverRepository) Delete(_a0 uint64) error
- func (_m *MockReceiverRepository) Get(_a0 uint64) (*Receiver, error)
- func (_m *MockReceiverRepository) List() ([]*Receiver, error)
- func (_m *MockReceiverRepository) Migrate() error
- func (_m *MockReceiverRepository) Update(_a0 *Receiver) (*Receiver, error)
- type MockSlackHelper
- type MockSlackRepository
- type Receiver
- type ReceiverRepository
- type Repository
- func (r Repository) Create(receiver *Receiver) (*Receiver, error)
- func (r Repository) Delete(id uint64) error
- func (r Repository) Get(id uint64) (*Receiver, error)
- func (r Repository) List() ([]*Receiver, error)
- func (r Repository) Migrate() error
- func (r Repository) Update(receiver *Receiver) (*Receiver, error)
- type Service
- func (service Service) CreateReceiver(receiver *domain.Receiver) (*domain.Receiver, error)
- func (service Service) DeleteReceiver(id uint64) error
- func (service Service) GetReceiver(id uint64) (*domain.Receiver, error)
- func (service Service) ListReceivers() ([]*domain.Receiver, error)
- func (service Service) Migrate() error
- func (service Service) UpdateReceiver(receiver *domain.Receiver) (*domain.Receiver, error)
- type SlackClient
- type SlackHelper
- type SlackRepository
- type StringInterfaceMap
- type StringStringMap
- type Transformer
Constants ¶
const OAuthServerEndpoint = "https://slack.com/api/oauth.v2.access"
const (
Slack string = "slack"
)
Variables ¶
This section is empty.
Functions ¶
func NewService ¶
NewService returns service struct
func NewSlackHelper ¶
Types ¶
type Exchanger ¶
type Exchanger interface {
Exchange(string, string, string) (CodeExchangeHTTPResponse, error)
}
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 MockReceiverRepository ¶
MockReceiverRepository is an autogenerated mock type for the ReceiverRepository type
func (*MockReceiverRepository) Create ¶
func (_m *MockReceiverRepository) Create(_a0 *Receiver) (*Receiver, error)
Create provides a mock function with given fields: _a0
func (*MockReceiverRepository) Delete ¶
func (_m *MockReceiverRepository) Delete(_a0 uint64) error
Delete provides a mock function with given fields: _a0
func (*MockReceiverRepository) Get ¶
func (_m *MockReceiverRepository) Get(_a0 uint64) (*Receiver, error)
Get provides a mock function with given fields: _a0
func (*MockReceiverRepository) List ¶
func (_m *MockReceiverRepository) List() ([]*Receiver, error)
List provides a mock function with given fields:
func (*MockReceiverRepository) Migrate ¶
func (_m *MockReceiverRepository) Migrate() error
Migrate provides a mock function with given fields:
type MockSlackHelper ¶
MockSlackHelper is an autogenerated mock type for the SlackHelper type
func (*MockSlackHelper) Decrypt ¶
func (_m *MockSlackHelper) Decrypt(_a0 string) (string, error)
Decrypt provides a mock function with given fields: _a0
func (*MockSlackHelper) Encrypt ¶
func (_m *MockSlackHelper) Encrypt(_a0 string) (string, error)
Encrypt provides a mock function with given fields: _a0
func (*MockSlackHelper) PostTransform ¶
func (_m *MockSlackHelper) PostTransform(_a0 *Receiver) (*Receiver, error)
PostTransform provides a mock function with given fields: _a0
func (*MockSlackHelper) PreTransform ¶
PreTransform provides a mock function with given fields: _a0
type MockSlackRepository ¶
MockSlackRepository is an autogenerated mock type for the MockSlackRepository type
func (*MockSlackRepository) GetWorkspaceChannels ¶
func (_m *MockSlackRepository) GetWorkspaceChannels(_a0 string) ([]Channel, error)
GetWorkspaceChannel provides a mock function with given fields: _a0
type Receiver ¶
type Receiver struct { Id uint64 `gorm:"primarykey"` Name string Type string Labels StringStringMap `gorm:"type:jsonb" sql:"type:jsonb" ` Configurations StringInterfaceMap `gorm:"type:jsonb" sql:"type:jsonb" ` Data StringInterfaceMap `gorm:"-"` CreatedAt time.Time UpdatedAt time.Time }
type ReceiverRepository ¶
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) *Repository
NewRepository returns repository struct
func (Repository) Delete ¶
func (r Repository) Delete(id uint64) error
func (Repository) List ¶
func (r Repository) List() ([]*Receiver, error)
func (Repository) Migrate ¶
func (r Repository) Migrate() error
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles business logic
func (Service) CreateReceiver ¶
func (Service) DeleteReceiver ¶
func (Service) GetReceiver ¶
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)
type SlackHelper ¶
type SlackRepository ¶
func NewSlackRepository ¶
func NewSlackRepository() SlackRepository
type StringInterfaceMap ¶
type StringInterfaceMap map[string]interface{}
func (*StringInterfaceMap) Scan ¶
func (m *StringInterfaceMap) Scan(value interface{}) error
type StringStringMap ¶
func (*StringStringMap) Scan ¶
func (m *StringStringMap) Scan(value interface{}) error