sqlstore

package
v0.0.0-...-67235b8 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const MySQLCharset = "DEFAULT CHARACTER SET utf8mb4"

Variables

This section is empty.

Functions

func LatestVersion

func LatestVersion() semver.Version

func NewWikiDocStore

func NewWikiDocStore(pluginAPI PluginAPIClient, log bot.Logger, sqlStore *SQLStore) app.WikiDocStore

NewWikiDocStore creates a new store for wikiDoc service.

Types

type ConfigurationAPI

type ConfigurationAPI interface {
	GetConfig() *model.Config
}

type KVAPI

type KVAPI interface {
	Get(key string, out interface{}) error
}

KVAPI is the key value store interface for the pluginkv stores. It is implemented by mattermost-plugin-api/Client.KV, or by the mock KVAPI.

type Migration

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

type PluginAPIClient

type PluginAPIClient struct {
	Store         StoreAPI
	KV            KVAPI
	Configuration ConfigurationAPI
}

PluginAPIClient is the struct combining the interfaces defined above, which is everything from pluginapi that the store currently uses.

func NewClient

func NewClient(api *pluginapi.Client) PluginAPIClient

NewClient receives a pluginapi.Client and returns the PluginAPIClient, which is what the store will use to access pluginapi.Client.

type SQLStore

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

func New

func New(pluginAPI PluginAPIClient, log bot.Logger) (*SQLStore, error)

New constructs a new instance of SQLStore.

func (*SQLStore) GetCurrentVersion

func (sqlStore *SQLStore) GetCurrentVersion() (semver.Version, error)

func (*SQLStore) RunMigrations

func (sqlStore *SQLStore) RunMigrations() error

RunMigrations will run the migrations (if any). The caller should hold a cluster mutex if there is a danger of this being run on multiple servers at once.

func (*SQLStore) SetCurrentVersion

func (sqlStore *SQLStore) SetCurrentVersion(e queryExecer, currentVersion semver.Version) error

type StoreAPI

type StoreAPI interface {
	GetMasterDB() (*sql.DB, error)
	DriverName() string
}

StoreAPI is the interface exposing the underlying database, provided by pluginapi It is implemented by mattermost-plugin-api/Client.Store, or by the mock StoreAPI.

Jump to

Keyboard shortcuts

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