mirror of
https://github.com/grafana/grafana.git
synced 2025-09-27 06:43:56 +08:00

* Simplistic store API for provenance lookups on arbitrary types * Add a few notes in comments * Improved type safety for provisioned objects * Clean-up TODOs for future PRs * Clean up provisioning model * Clean up tests * Restrict allowable types in interface * Fix linter error * Move AlertRule domain methods to same file as AlertRule definition * Update pkg/services/ngalert/models/provisioning.go Co-authored-by: George Robinson <george.robinson@grafana.com> * Complete interface rename * Pass context through store API * More idiomatic method names * Better error description * Improve code-docs * Use ORM language instead of raw sql * Add support for records in different orgs * ResourceTypeID -> ResourceType since it's not an ID Co-authored-by: George Robinson <george.robinson@grafana.com>
17 lines
381 B
Go
17 lines
381 B
Go
package models
|
|
|
|
type Provenance string
|
|
|
|
const (
|
|
ProvenanceNone Provenance = ""
|
|
ProvenanceApi Provenance = "api"
|
|
ProvenanceFile Provenance = "file"
|
|
)
|
|
|
|
// Provisionable represents a resource that can be created through a provisioning mechanism, such as Terraform or config file.
|
|
type Provisionable interface {
|
|
ResourceType() string
|
|
ResourceID() string
|
|
ResourceOrgID() int64
|
|
}
|