app

package
v0.221.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 11 Imported by: 7

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(ctx context.Context, 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

	// TracingOpts contains settings for tracing setup.
	TracingOpts tracing.Opts
}

ManageOpts can modify Manage behaviour.

Jump to

Keyboard shortcuts

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