mirror of
https://github.com/grafana/grafana.git
synced 2025-09-26 20:34:25 +08:00

* Spike: Extras * Attempt to wire it up * Hack * Fix issue with jobs * Wire more things up * Fix more wiring stuff * Remove webhook secret key from main registration * Move secret encryption also outside register * Add TODOs in code * Add more explanations * Move connectors to different package * Move pull request job into webhooks * Separate registration * Remove duplicate files * Fix missing function * Extract webhook repository logic out of the core github repository * Use status patcher in webhook connector * Fix change in go mod * Change hooks signature * Remove TODOs * Remove Webhook methos from go-git * Remove leftover * Fix mistake in OpenAPI spec * Fix some tests * Fix some issues * Fix linting
55 lines
1.9 KiB
Go
55 lines
1.9 KiB
Go
package apiregistry
|
|
|
|
import (
|
|
"github.com/google/wire"
|
|
|
|
dashboardinternal "github.com/grafana/grafana/pkg/registry/apis/dashboard"
|
|
"github.com/grafana/grafana/pkg/registry/apis/dashboardsnapshot"
|
|
"github.com/grafana/grafana/pkg/registry/apis/datasource"
|
|
"github.com/grafana/grafana/pkg/registry/apis/featuretoggle"
|
|
"github.com/grafana/grafana/pkg/registry/apis/folders"
|
|
"github.com/grafana/grafana/pkg/registry/apis/iam"
|
|
"github.com/grafana/grafana/pkg/registry/apis/provisioning"
|
|
"github.com/grafana/grafana/pkg/registry/apis/provisioning/webhooks"
|
|
"github.com/grafana/grafana/pkg/registry/apis/query"
|
|
"github.com/grafana/grafana/pkg/registry/apis/secret"
|
|
"github.com/grafana/grafana/pkg/registry/apis/service"
|
|
"github.com/grafana/grafana/pkg/registry/apis/userstorage"
|
|
"github.com/grafana/grafana/pkg/services/pluginsintegration/plugincontext"
|
|
)
|
|
|
|
// HACK: This is a hack so that wire can uniquely identify dependencies
|
|
func MergeProvisioningExtras(webhook webhooks.WebhookExtraBuilder) []provisioning.ExtraBuilder {
|
|
return []provisioning.ExtraBuilder{
|
|
webhook.ExtraBuilder,
|
|
}
|
|
}
|
|
|
|
var ProvisioningExtras = wire.NewSet(
|
|
webhooks.ProvideWebhooks,
|
|
MergeProvisioningExtras,
|
|
)
|
|
|
|
var WireSet = wire.NewSet(
|
|
ProvideRegistryServiceSink, // dummy background service that forces registration
|
|
|
|
// read-only datasource abstractions
|
|
plugincontext.ProvideService,
|
|
wire.Bind(new(datasource.PluginContextWrapper), new(*plugincontext.Provider)),
|
|
datasource.ProvideDefaultPluginConfigs,
|
|
|
|
// Each must be added here *and* in the ServiceSink above
|
|
dashboardinternal.RegisterAPIService,
|
|
dashboardsnapshot.RegisterAPIService,
|
|
featuretoggle.RegisterAPIService,
|
|
datasource.RegisterAPIService,
|
|
folders.RegisterAPIService,
|
|
iam.RegisterAPIService,
|
|
ProvisioningExtras,
|
|
provisioning.RegisterAPIService,
|
|
service.RegisterAPIService,
|
|
query.RegisterAPIService,
|
|
secret.RegisterAPIService,
|
|
userstorage.RegisterAPIService,
|
|
)
|