mirror of
https://github.com/mattermost/focalboard.git
synced 2024-12-27 13:48:52 +02:00
d093eef2d9
This reverts commit 605c0079eb
.
39 lines
775 B
Go
39 lines
775 B
Go
package sqlstore
|
|
|
|
import (
|
|
"database/sql"
|
|
"fmt"
|
|
|
|
"github.com/mattermost/mattermost-server/v6/plugin"
|
|
|
|
"github.com/mattermost/mattermost-server/v6/shared/mlog"
|
|
)
|
|
|
|
type Params struct {
|
|
DBType string
|
|
ConnectionString string
|
|
TablePrefix string
|
|
Logger *mlog.Logger
|
|
DB *sql.DB
|
|
IsPlugin bool
|
|
IsSingleUser bool
|
|
NewMutexFn MutexFactory
|
|
PluginAPI *plugin.API
|
|
}
|
|
|
|
func (p Params) CheckValid() error {
|
|
if p.IsPlugin && p.NewMutexFn == nil {
|
|
return ErrStoreParam{name: "NewMutexFn", issue: "cannot be nil in plugin mode"}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type ErrStoreParam struct {
|
|
name string
|
|
issue string
|
|
}
|
|
|
|
func (e ErrStoreParam) Error() string {
|
|
return fmt.Sprintf("invalid store params: %s %s", e.name, e.issue)
|
|
}
|