The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/pkg/registry/apis/provisioning/repository/context.go

31 lines
725 B

package repository
import (
"context"
"time"
)
// When writing values from history, we want the metadata to match Legacy grafana SQL
type CommitSignature struct {
// Name represents a person name. It is an arbitrary string.
Name string
// Email is an email, but it cannot be assumed to be well-formed.
Email string
// When is the timestamp of the signature.
When time.Time
}
type ctxAuthorKey struct{}
func WithAuthorSignature(ctx context.Context, sig CommitSignature) context.Context {
return context.WithValue(ctx, ctxAuthorKey{}, sig)
}
func GetAuthorSignature(ctx context.Context) *CommitSignature {
u, ok := ctx.Value(ctxAuthorKey{}).(CommitSignature)
if ok {
copy := u
return &copy
}
return nil
}