mirror of
https://github.com/grafana/grafana.git
synced 2025-02-16 18:34:52 -06:00
* Template service * Add GET routes and implement them * Generate mock for persist layer * Unit tests for reading templates * Set up composition root and get integration tests working * Fix prealloc issue * Extract setup boilerplate * Update AuthorizationTest * Rebase and resolve * Fix linter error
28 lines
1.2 KiB
Go
28 lines
1.2 KiB
Go
package provisioning
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/grafana/grafana/pkg/services/ngalert/models"
|
|
)
|
|
|
|
// AMStore is a store of Alertmanager configurations.
|
|
//go:generate mockery --name AMConfigStore --structname MockAMConfigStore --inpackage --filename persist_mock.go --with-expecter
|
|
type AMConfigStore interface {
|
|
GetLatestAlertmanagerConfiguration(ctx context.Context, query *models.GetLatestAlertmanagerConfigurationQuery) error
|
|
UpdateAlertmanagerConfiguration(ctx context.Context, cmd *models.SaveAlertmanagerConfigurationCmd) error
|
|
}
|
|
|
|
// ProvisioningStore is a store of provisioning data for arbitrary objects.
|
|
type ProvisioningStore interface {
|
|
GetProvenance(ctx context.Context, o models.Provisionable, org int64) (models.Provenance, error)
|
|
GetProvenances(ctx context.Context, org int64, resourceType string) (map[string]models.Provenance, error)
|
|
SetProvenance(ctx context.Context, o models.Provisionable, org int64, p models.Provenance) error
|
|
DeleteProvenance(ctx context.Context, o models.Provisionable, org int64) error
|
|
}
|
|
|
|
// TransactionManager represents the ability to issue and close transactions through contexts.
|
|
type TransactionManager interface {
|
|
InTransaction(ctx context.Context, work func(ctx context.Context) error) error
|
|
}
|