Documentation ¶
Index ¶
- Constants
- func GetTopPlaybooksInsightsListWithPagination(playbooks []*app.PlaybookInsight, limit int) *app.PlaybooksInsightsList
- func LatestVersion() semver.Version
- func NewCategoryStore(pluginAPI PluginAPIClient, log bot.Logger, sqlStore *SQLStore) app.CategoryStore
- func NewChannelActionStore(pluginAPI PluginAPIClient, log bot.Logger, sqlStore *SQLStore) app.ChannelActionStore
- func NewPlaybookRunStore(pluginAPI PluginAPIClient, log bot.Logger, sqlStore *SQLStore) app.PlaybookRunStore
- func NewPlaybookStore(pluginAPI PluginAPIClient, log bot.Logger, sqlStore *SQLStore) app.PlaybookStore
- func NewUserInfoStore(sqlStore *SQLStore) app.UserInfoStore
- type ConfigurationAPI
- type IndexInfo
- type KVAPI
- type Migration
- type PluginAPIClient
- type SQLStore
- type StatsFilters
- type StatsStore
- func (s *StatsStore) ActiveParticipantsPerDayLastXDays(x int, filters *StatsFilters) ([]int, [][]int64)
- func (s *StatsStore) ActiveRunsPerDayLastXDays(x int, filters *StatsFilters) ([]int, [][]int64)
- func (s *StatsStore) MetricOverallAverage(filters StatsFilters) []null.Int
- func (s *StatsStore) MetricRollingAverageAndChange(x int, filters StatsFilters) (metricRollingAverage []null.Int, metricRollingAverageChange []null.Int)
- func (s *StatsStore) MetricRollingValuesLastXRuns(x int, offset int, filters StatsFilters) ([][]int64, []string)
- func (s *StatsStore) MetricValueRange(filters StatsFilters) [][]int64
- func (s *StatsStore) MovingWindowQueryActive(query sq.SelectBuilder, numDays int) ([]int, error)
- func (s *StatsStore) RunsFinishedBetweenDays(filters *StatsFilters, startDay, endDay int) int
- func (s *StatsStore) RunsStartedPerWeekLastXWeeks(x int, filters *StatsFilters) ([]int, [][]int64)
- func (s *StatsStore) TotalActiveParticipants(filters *StatsFilters) int
- func (s *StatsStore) TotalInProgressPlaybookRuns(filters *StatsFilters) int
- func (s *StatsStore) TotalPlaybookRuns() (int, error)
- func (s *StatsStore) TotalPlaybooks() (int, error)
- type StoreAPI
- type TableInfo
Constants ¶
const MySQLCharset = "DEFAULT CHARACTER SET utf8mb4"
Variables ¶
This section is empty.
Functions ¶
func GetTopPlaybooksInsightsListWithPagination ¶ added in v1.32.0
func GetTopPlaybooksInsightsListWithPagination(playbooks []*app.PlaybookInsight, limit int) *app.PlaybooksInsightsList
GetTopPlaybooksInsightsListWithPagination returns a page given a list of PlaybooksInsight assumed to be sorted by Runs(score). Returns a PlaybooksInsightsList.
func LatestVersion ¶
func NewCategoryStore ¶ added in v1.31.0
func NewCategoryStore(pluginAPI PluginAPIClient, log bot.Logger, sqlStore *SQLStore) app.CategoryStore
func NewChannelActionStore ¶ added in v1.26.0
func NewChannelActionStore(pluginAPI PluginAPIClient, log bot.Logger, sqlStore *SQLStore) app.ChannelActionStore
NewPlaybookStore creates a new store for playbook service.
func NewPlaybookRunStore ¶
func NewPlaybookRunStore(pluginAPI PluginAPIClient, log bot.Logger, sqlStore *SQLStore) app.PlaybookRunStore
NewPlaybookRunStore creates a new store for playbook run ServiceImpl.
func NewPlaybookStore ¶
func NewPlaybookStore(pluginAPI PluginAPIClient, log bot.Logger, sqlStore *SQLStore) app.PlaybookStore
NewPlaybookStore creates a new store for playbook service.
func NewUserInfoStore ¶
func NewUserInfoStore(sqlStore *SQLStore) app.UserInfoStore
Types ¶
type ConfigurationAPI ¶
type KVAPI ¶
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 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, scheduler app.JobOnceScheduler) (*SQLStore, error)
New constructs a new instance of SQLStore.
func (*SQLStore) GetCurrentVersion ¶
func (*SQLStore) RunMigrations ¶
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.
type StatsFilters ¶
type StatsStore ¶
type StatsStore struct {
// contains filtered or unexported fields
}
func NewStatsStore ¶
func NewStatsStore(pluginAPI PluginAPIClient, log bot.Logger, sqlStore *SQLStore) *StatsStore
func (*StatsStore) ActiveParticipantsPerDayLastXDays ¶
func (s *StatsStore) ActiveParticipantsPerDayLastXDays(x int, filters *StatsFilters) ([]int, [][]int64)
ActiveParticipantsPerDayLastXDays returns the number of active participants per day for the last X days. Returns data in order of oldest day to most recent day.
func (*StatsStore) ActiveRunsPerDayLastXDays ¶
func (s *StatsStore) ActiveRunsPerDayLastXDays(x int, filters *StatsFilters) ([]int, [][]int64)
ActiveRunsPerDayLastXDays returns the number of active runs per day for the last X days. Returns data in order of oldest day to most recent day.
func (*StatsStore) MetricOverallAverage ¶
func (s *StatsStore) MetricOverallAverage(filters StatsFilters) []null.Int
MetricOverallAverage for a specific playbook returns a list that contains an average value for each metric. Only published metrics values are included. Returns empty list when Playbook doesn't have configured metrics If for some metrics there are no published values, the corresponding element will be nil in the resulting slice
func (*StatsStore) MetricRollingAverageAndChange ¶
func (s *StatsStore) MetricRollingAverageAndChange(x int, filters StatsFilters) (metricRollingAverage []null.Int, metricRollingAverageChange []null.Int)
MetricRollingAverageAndChange for each metric returns average of last `x` published values and change with comparison to the previous period returns empty list if the Playbook doesn't have metrics If for some metrics there are no published values, the corresponding element will be nil in the resulting slice
func (*StatsStore) MetricRollingValuesLastXRuns ¶
func (s *StatsStore) MetricRollingValuesLastXRuns(x int, offset int, filters StatsFilters) ([][]int64, []string)
MetricRollingValuesLastXRuns for each metric returns list of last `x` published values, starting from `offset` first element in the list is most recent. And returns the names of the last `x` runs. Returns empty list if Playbook doesn't have metrics. If for some metrics there are no published values, the corresponding slice will be nil in the resulting slice
func (*StatsStore) MetricValueRange ¶
func (s *StatsStore) MetricValueRange(filters StatsFilters) [][]int64
MetricValueRange returns min and max values for each metric Only published metrics are included. If there are no configured metrics, returns an empty list If for some metrics there are no published values, the corresponding slice will be nil in the resulting slice
func (*StatsStore) MovingWindowQueryActive ¶
func (s *StatsStore) MovingWindowQueryActive(query sq.SelectBuilder, numDays int) ([]int, error)
Not efficient. One query per day.
func (*StatsStore) RunsFinishedBetweenDays ¶
func (s *StatsStore) RunsFinishedBetweenDays(filters *StatsFilters, startDay, endDay int) int
RunsFinishedBetweenDays are calculated from startDay to endDay (inclusive), where "days" are "number of days ago". E.g., for the last 30 days, begin day would be 30 (days ago), end day would be 0 (days ago) (up until now).
func (*StatsStore) RunsStartedPerWeekLastXWeeks ¶
func (s *StatsStore) RunsStartedPerWeekLastXWeeks(x int, filters *StatsFilters) ([]int, [][]int64)
RunsStartedPerWeekLastXWeeks returns the number of runs started each week for the last X weeks. Returns data in order of oldest week to most recent week.
func (*StatsStore) TotalActiveParticipants ¶
func (s *StatsStore) TotalActiveParticipants(filters *StatsFilters) int
func (*StatsStore) TotalInProgressPlaybookRuns ¶
func (s *StatsStore) TotalInProgressPlaybookRuns(filters *StatsFilters) int
func (*StatsStore) TotalPlaybookRuns ¶ added in v1.28.0
func (s *StatsStore) TotalPlaybookRuns() (int, error)
TotalPlaybookRuns returns the number of playbook runs in the server
func (*StatsStore) TotalPlaybooks ¶ added in v1.28.0
func (s *StatsStore) TotalPlaybooks() (int, error)
TotalPlaybooks returns the number of playbooks in the server