Documentation ¶
Index ¶
- Variables
- func CheckSubscriptionPermission(checker PermissionChecker, sub apps.Subscription, channelID, teamID string) error
- type AppServices
- func (a *AppServices) GetOAuth2User(r *incoming.Request, appID apps.AppID, actingUserID string) ([]byte, error)
- func (a *AppServices) GetSubscriptions(r *incoming.Request, appID apps.AppID, userID string) ([]apps.Subscription, error)
- func (a *AppServices) KVDelete(r *incoming.Request, appID apps.AppID, actingUserID, prefix, id string) error
- func (a *AppServices) KVGet(r *incoming.Request, appID apps.AppID, actingUserID, prefix, id string) ([]byte, error)
- func (a *AppServices) KVList(r *incoming.Request, appID apps.AppID, actingUserID, prefix string, ...) error
- func (a *AppServices) KVSet(r *incoming.Request, appID apps.AppID, actingUserID, prefix, id string, ...) (bool, error)
- func (a *AppServices) StoreOAuth2App(r *incoming.Request, appID apps.AppID, actingUserID string, data []byte) error
- func (a *AppServices) StoreOAuth2User(r *incoming.Request, appID apps.AppID, actingUserID string, data []byte) error
- func (a *AppServices) Subscribe(r *incoming.Request, sub apps.Subscription) error
- func (a *AppServices) Unsubscribe(r *incoming.Request, sub apps.Subscription) error
- type PermissionChecker
- type Service
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrIsABot = errors.New("is a bot")
View Source
var ErrNotABot = errors.New("not a bot")
Functions ¶
func CheckSubscriptionPermission ¶ added in v1.0.0
func CheckSubscriptionPermission(checker PermissionChecker, sub apps.Subscription, channelID, teamID string) error
Types ¶
type AppServices ¶
type AppServices struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(conf config.Service, store *store.Service) *AppServices
func (*AppServices) GetOAuth2User ¶ added in v0.3.0
func (a *AppServices) GetOAuth2User(r *incoming.Request, appID apps.AppID, actingUserID string) ([]byte, error)
GetOAuth2User returns the stored OAuth2 user data for a given user and app. If err != nil, the returned data is always valid JSON.
func (*AppServices) GetSubscriptions ¶ added in v1.0.0
func (a *AppServices) GetSubscriptions(r *incoming.Request, appID apps.AppID, userID string) ([]apps.Subscription, error)
func (*AppServices) KVGet ¶
func (a *AppServices) KVGet(r *incoming.Request, appID apps.AppID, actingUserID, prefix, id string) ([]byte, error)
KVGet returns the stored KV data for a given user and app. If err != nil, the returned data is always valid JSON.
func (*AppServices) StoreOAuth2App ¶ added in v0.3.0
func (*AppServices) StoreOAuth2User ¶ added in v0.3.0
func (*AppServices) Subscribe ¶
func (a *AppServices) Subscribe(r *incoming.Request, sub apps.Subscription) error
func (*AppServices) Unsubscribe ¶
func (a *AppServices) Unsubscribe(r *incoming.Request, sub apps.Subscription) error
type PermissionChecker ¶ added in v1.0.0
type PermissionChecker interface { HasPermissionTo(userID string, permission *model.Permission) bool HasPermissionToChannel(userID, channelID string, permission *model.Permission) bool HasPermissionToTeam(userID, teamID string, permission *model.Permission) bool }
type Service ¶
type Service interface { Subscribe(r *incoming.Request, sub apps.Subscription) error GetSubscriptions(r *incoming.Request, appID apps.AppID, actingUserID string) ([]apps.Subscription, error) Unsubscribe(r *incoming.Request, sub apps.Subscription) error KVSet(r *incoming.Request, appID apps.AppID, actingUserID, prefix, id string, data []byte) (bool, error) KVGet(r *incoming.Request, appID apps.AppID, actingUserID, prefix, id string) ([]byte, error) KVDelete(r *incoming.Request, appID apps.AppID, actingUserID, prefix, id string) error KVList(r *incoming.Request, appID apps.AppID, actingUserID, namespace string, processf func(key string) error) error StoreOAuth2App(r *incoming.Request, appID apps.AppID, actingUserID string, data []byte) error StoreOAuth2User(r *incoming.Request, AppID apps.AppID, actingUserID string, data []byte) error GetOAuth2User(r *incoming.Request, appID apps.AppID, actingUserID string) ([]byte, error) }
Click to show internal directories.
Click to hide internal directories.