Documentation ¶
Overview ¶
Package app provides utilities for creating and serving a app plugin over gRPC.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Manage ¶
func Manage(pluginID string, instanceFactory InstanceFactoryFunc, opts ManageOpts) error
Manage starts serving the app over gPRC with automatic instance management. pluginID should match the one from plugin.json.
func NewInstanceManager ¶
func NewInstanceManager(fn InstanceFactoryFunc) instancemgmt.InstanceManager
NewInstanceManager creates a new app instance manager,
This is a helper method for calling NewInstanceProvider and creating a new instancemgmt.InstanceProvider, and providing that to instancemgmt.New.
func NewInstanceProvider ¶
func NewInstanceProvider(fn InstanceFactoryFunc) instancemgmt.InstanceProvider
NewInstanceProvider create a new app instance provider,
The instance provider is responsible for providing cache keys for application instances, creating new instances when needed and invalidating cached instances when they have been updated in Grafana. Cache key is based on the app plugin identifier, and the numeric Grafana organization ID. If fn is nil, NewInstanceProvider panics.
Types ¶
type InstanceFactoryFunc ¶
type InstanceFactoryFunc func(settings backend.AppInstanceSettings) (instancemgmt.Instance, error)
InstanceFactoryFunc factory method for creating app instances.
type ManageOpts ¶
type ManageOpts struct { // GRPCSettings settings for gPRC. GRPCSettings backend.GRPCSettings }
ManageOpts can modify Manage behaviour.