appservices

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

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

This section is empty.

Types

type AppServices

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

func NewService

func NewService(mm *pluginapi.Client, conf config.Service, store *store.Service) *AppServices

func (*AppServices) GetOAuth2User added in v0.3.0

func (a *AppServices) GetOAuth2User(appID apps.AppID, actingUserID string, ref interface{}) error

func (*AppServices) KVDelete

func (a *AppServices) KVDelete(botUserID, prefix, id string) error

func (*AppServices) KVGet

func (a *AppServices) KVGet(botUserID, prefix, id string, ref interface{}) error

func (*AppServices) KVSet

func (a *AppServices) KVSet(botUserID, prefix, id string, ref interface{}) (bool, error)

func (*AppServices) StoreOAuth2App added in v0.3.0

func (a *AppServices) StoreOAuth2App(appID apps.AppID, actingUserID string, oapp apps.OAuth2App) error

func (*AppServices) StoreOAuth2User added in v0.3.0

func (a *AppServices) StoreOAuth2User(appID apps.AppID, actingUserID string, ref interface{}) error

func (*AppServices) Subscribe

func (a *AppServices) Subscribe(actingUserID string, sub *apps.Subscription) error

func (*AppServices) Unsubscribe

func (a *AppServices) Unsubscribe(actingUserID string, sub *apps.Subscription) error

type Service

type Service interface {
	Subscribe(actingUserID string, _ *apps.Subscription) error
	Unsubscribe(actingUserID string, _ *apps.Subscription) error

	// ref can be either a []byte for raw data, or anything else will be JSON marshaled.
	KVSet(botUserID, prefix, id string, ref interface{}) (bool, error)
	KVGet(botUserID, prefix, id string, ref interface{}) error
	KVDelete(botUserID, prefix, id string) error

	StoreOAuth2App(_ apps.AppID, actingUserID string, oapp apps.OAuth2App) error
	GetOAuth2User(_ apps.AppID, actingUserID string, ref interface{}) error
	// ref can be either a []byte, or anything else will be JSON marshaled.
	StoreOAuth2User(_ apps.AppID, actingUserID string, ref interface{}) error
}

Jump to

Keyboard shortcuts

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