store

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeManifest

func DecodeManifest(data []byte) (*apps.Manifest, error)

func SortApps

func SortApps(appsMap map[apps.AppID]*apps.App) []*apps.App

Types

type AppKVStore added in v0.3.0

type AppKVStore interface {
	Set(botUserID, prefix, id string, ref interface{}) (bool, error)
	Get(botUserID, prefix, id string, ref interface{}) error
	Delete(botUserID, prefix, id string) error
}

type AppStore

type AppStore interface {
	config.Configurable

	AsMap() map[apps.AppID]*apps.App
	Delete(apps.AppID) error
	Get(appID apps.AppID) (*apps.App, error)
	InitBuiltin(...*apps.App)
	Save(app *apps.App) error
}

type ManifestStore

type ManifestStore interface {
	config.Configurable

	AsMap() map[apps.AppID]*apps.Manifest
	DeleteLocal(apps.AppID) error
	Get(apps.AppID) (*apps.Manifest, error)
	InitGlobal(_ aws.Client, bucket string) error
	StoreLocal(*apps.Manifest) error
}

type OAuth2Store added in v0.3.0

type OAuth2Store interface {
	CreateState(actingUserID string) (string, error)
	ValidateStateOnce(urlState, actingUserID string) error
	SaveUser(botUserID, mattermostUserID string, ref interface{}) error
	GetUser(botUserID, mattermostUserID string, ref interface{}) error
}

type Service

type Service struct {
	App          AppStore
	Subscription SubscriptionStore
	Manifest     ManifestStore
	AppKV        AppKVStore
	OAuth2       OAuth2Store
	// contains filtered or unexported fields
}

func NewService

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

type SubscriptionStore

type SubscriptionStore interface {
	Get(subject apps.Subject, teamID, channelID string) ([]*apps.Subscription, error)
	Save(sub *apps.Subscription) error
	Delete(*apps.Subscription) error
}

Jump to

Keyboard shortcuts

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