registry

package
v0.0.85-test Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2023 License: AGPL-3.0 Imports: 2 Imported by: 1,502

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDisabled

func IsDisabled(srv BackgroundService) bool

IsDisabled returns whether a background service is disabled.

Types

type BackgroundService

type BackgroundService interface {
	// Run starts the background process of the service after `Init` have been called
	// on all services. The `context.Context` passed into the function should be used
	// to subscribe to ctx.Done() so the service can be notified when Grafana shuts down.
	Run(ctx context.Context) error
}

BackgroundService should be implemented for services that have long running tasks in the background.

type BackgroundServiceRegistry

type BackgroundServiceRegistry interface {
	GetServices() []BackgroundService
}

BackgroundServiceRegistry provides background services.

type CanBeDisabled

type CanBeDisabled interface {
	// IsDisabled should return a bool saying if it can be started or not.
	IsDisabled() bool
}

CanBeDisabled allows the services to decide if it should be started or not by itself. This is useful for services that might not always be started, ex alerting. This will be called after `Init()`.

type DatabaseMigrator

type DatabaseMigrator interface {
	// AddMigrations allows the service to add migrations to
	// the database migrator.
	AddMigration(mg *migrator.Migrator)
}

DatabaseMigrator allows the caller to add migrations to the migrator passed as argument

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL