store

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const UserStoreKeyPrefix = "user_"

UserStoreKeyPrefix prefix for user data key is KVStore.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	KVGet(key string) ([]byte, *model.AppError)
	KVSet(key string, value []byte) *model.AppError
	KVDelete(key string) *model.AppError
	LogDebug(msg string, keyValuePairs ...interface{})
	LogInfo(msg string, keyValuePairs ...interface{})
	LogError(msg string, keyValuePairs ...interface{})
	LogWarn(msg string, keyValuePairs ...interface{})
}

API that store uses for interactions with KVStore

type AlertStore

type AlertStore interface {
	GetChannelIDForAlert(alert string) (string, error)
	GetChannelAlertIDs(channelID string) ([]string, error)
	CreateAlert(channelID string, alertsID string) error
	DeleteChannelAlert(channelID string, alertsID string) error
}

AlertStore API for alert KVStore.

type KVStore

type KVStore interface {
	Load(key string) ([]byte, error)
	Store(key string, data []byte) error
	Delete(key string) error
	// contains filtered or unexported methods
}

KVStore abstraction for plugin.API.KVStore

func NewStore

func NewStore(api API) KVStore

NewStore creates KVStore from plugin.API

type SplunkUser

type SplunkUser struct {
	Server   string
	UserName string
	Token    string
}

SplunkUser stores splunk user info.

type Store

type Store interface {
	UserStore
	AlertStore
}

Store encapsulates all store APIs

func NewPluginStore

func NewPluginStore(api API) Store

NewPluginStore creates Store object from plugin.API

type UserStore

type UserStore interface {
	CurrentUser(mattermostUserID string) (SplunkUser, error)
	User(mattermostUserID string, server string, username string) (SplunkUser, error)

	ChangeCurrentUser(mattermostUserID string, userName string) error
	RegisterUser(mattermostUserID string, user SplunkUser) error
	DeleteUser(mattermostUserID string, server string, userName string) error
}

UserStore API for user KVStore.

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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