store

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hashkey added in v1.0.0

func Hashkey(globalNamespace string, appID apps.AppID, userID, appNamespace, key string) (string, error)

func ParseHashkey added in v1.0.0

func ParseHashkey(key string) (globalNamespace string, appID apps.AppID, userID, appNamespace, idhash string, err 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(_ apps.AppID, actingUserID, prefix, id string, data []byte) (bool, error)
	Get(_ apps.AppID, actingUserID, prefix, id string) ([]byte, error)
	Delete(_ apps.AppID, actingUserID, prefix, id string) error
	List(_ *incoming.Request, _ apps.AppID, actingUserID, namespace string, processf func(key string) error) error
}

type AppStore

type AppStore interface {
	config.Configurable

	InitBuiltin(...apps.App)

	Get(apps.AppID) (*apps.App, error)
	AsMap() map[apps.AppID]apps.App
	Save(*incoming.Request, apps.App) error
	Delete(*incoming.Request, apps.AppID) error
}

type ManifestStore

type ManifestStore interface {
	config.Configurable

	StoreLocal(*incoming.Request, apps.Manifest) error
	Get(apps.AppID) (*apps.Manifest, error)
	GetFromS3(appID apps.AppID, version apps.AppVersion) (*apps.Manifest, error)
	AsMap() map[apps.AppID]apps.Manifest
	DeleteLocal(*incoming.Request, apps.AppID) error
}

type OAuth2Store added in v0.3.0

type OAuth2Store interface {
	CreateState(actingUserID string) (string, error)
	ValidateStateOnce(urlState, actingUserID string) error
	SaveUser(appID apps.AppID, actingUserID string, data []byte) error
	GetUser(appID apps.AppID, actingUserID string) ([]byte, error)
}

type Service

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

func MakeService added in v1.0.0

func MakeService(log utils.Logger, confService config.Service, httpOut httpout.Service) (*Service, error)

type SessionStore added in v1.0.0

type SessionStore interface {
	Get(_ apps.AppID, userID string) (*model.Session, error)
	ListForApp(apps.AppID) ([]*model.Session, error)
	ListForUser(_ *incoming.Request, userID string) ([]*model.Session, error)
	Save(_ apps.AppID, userID string, session *model.Session) error
	Delete(_ apps.AppID, userID string) error
	DeleteAllForApp(*incoming.Request, apps.AppID) error
	DeleteAllForUser(_ *incoming.Request, userID string) error
}

type SubscriptionStore

type SubscriptionStore interface {
	Get(_ apps.Subject, teamID, channelID string) ([]apps.Subscription, error)
	List() ([]apps.Subscription, error)
	ListByUserID(_ apps.AppID, userID string) ([]apps.Subscription, error)
	Save(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