appservices

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppServices

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

func NewService

func NewService(store *store.Service) *AppServices

func (*AppServices) GetOAuth2User added in v0.3.0

func (a *AppServices) GetOAuth2User(r *incoming.Request) ([]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) (out []apps.Subscription, err error)

func (*AppServices) KVDebugAppInfo added in v1.2.0

func (a *AppServices) KVDebugAppInfo(r *incoming.Request, appID apps.AppID) (*store.KVDebugAppInfo, error)

func (*AppServices) KVDebugInfo added in v1.2.0

func (a *AppServices) KVDebugInfo(r *incoming.Request) (*store.KVDebugInfo, error)

func (*AppServices) KVDelete

func (a *AppServices) KVDelete(r *incoming.Request, prefix, id string) error

func (*AppServices) KVGet

func (a *AppServices) KVGet(r *incoming.Request, 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) KVList added in v1.0.0

func (a *AppServices) KVList(r *incoming.Request, prefix string, processf func(key string) error) error

func (*AppServices) KVSet

func (a *AppServices) KVSet(r *incoming.Request, prefix, id string, data []byte) (bool, error)

func (*AppServices) StoreOAuth2App added in v0.3.0

func (a *AppServices) StoreOAuth2App(r *incoming.Request, data []byte) error

func (*AppServices) StoreOAuth2User added in v0.3.0

func (a *AppServices) StoreOAuth2User(r *incoming.Request, data []byte) error

func (*AppServices) Subscribe

func (a *AppServices) Subscribe(r *incoming.Request, sub apps.Subscription) error

func (*AppServices) Unsubscribe

func (a *AppServices) Unsubscribe(r *incoming.Request, e apps.Event) error

func (*AppServices) UnsubscribeApp added in v1.2.0

func (a *AppServices) UnsubscribeApp(r *incoming.Request, appID apps.AppID) 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(*incoming.Request, apps.Subscription) error
	GetSubscriptions(*incoming.Request) ([]apps.Subscription, error)
	Unsubscribe(*incoming.Request, apps.Event) error
	UnsubscribeApp(*incoming.Request, apps.AppID) error

	KVSet(_ *incoming.Request, prefix, id string, data []byte) (bool, error)
	KVGet(_ *incoming.Request, prefix, id string) ([]byte, error)
	KVDelete(_ *incoming.Request, prefix, id string) error
	KVList(_ *incoming.Request, namespace string, processf func(key string) error) error
	KVDebugInfo(*incoming.Request) (*store.KVDebugInfo, error)
	KVDebugAppInfo(*incoming.Request, apps.AppID) (*store.KVDebugAppInfo, error)

	StoreOAuth2App(_ *incoming.Request, data []byte) error
	StoreOAuth2User(_ *incoming.Request, data []byte) error
	GetOAuth2User(_ *incoming.Request) ([]byte, error)
}

Jump to

Keyboard shortcuts

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