experimental

package
v0.179.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

README

Plugin SDK experimental packages

This package contains experimental packages

History

  • Experimental package sdata has been moved into its own package after few experiments here. If you are using sdata from plugin SDK, consider it from dataplane package which is available in github.com/grafana/dataplane/sdata.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckGoldenDataResponse deprecated

func CheckGoldenDataResponse(path string, dr *backend.DataResponse, updateFile bool) error

CheckGoldenDataResponse will verify that the stored file matches the given data.DataResponse when the updateFile flag is set, this will both add errors to the response and update the saved file

Deprecated: Use CheckGoldenJSONResponse instead

func CheckGoldenFrame deprecated

func CheckGoldenFrame(path string, f *data.Frame, updateFile bool) error

CheckGoldenFrame calls CheckGoldenDataResponse using a single frame

Deprecated: Use CheckGoldenJSONFrame instead

func CheckGoldenFramer deprecated

func CheckGoldenFramer(path string, f data.Framer, updateFile bool) error

CheckGoldenFramer calls CheckGoldenDataResponse using a data.Framer instead of a backend.DataResponse.

Deprecated: Use CheckGoldenJSONFramer instead

func CheckGoldenJSONFrame

func CheckGoldenJSONFrame(t *testing.T, dir string, name string, f *data.Frame, updateFile bool)

CheckGoldenJSONFrame calls CheckGoldenJSONResponse using a single frame.

func CheckGoldenJSONFramer

func CheckGoldenJSONFramer(t *testing.T, dir string, name string, f data.Framer, updateFile bool)

CheckGoldenJSONFramer calls CheckGoldenJSONResponse using a data.Framer instead of a backend.DataResponse.

func CheckGoldenJSONResponse

func CheckGoldenJSONResponse(t *testing.T, dir string, name string, dr *backend.DataResponse, updateFile bool)

CheckGoldenJSONResponse will verify that the stored JSON file matches the given backend.DataResponse.

func GetDirectoryFrame

func GetDirectoryFrame(p string, details bool) (*data.Frame, error)

Types

type Client

type Client interface {
	// Fetch performs an HTTP GET and returns the body as []byte to prep for marshalling.
	Fetch(ctx context.Context, uriPath, uriQuery string) ([]byte, error)

	// Get performs an HTTP GET and returns the response.
	// This can be used directly from resource calls that don't need to marshal the data
	Get(ctx context.Context, uriPath, uriQuery string) (*http.Response, error)
}

Client implements a REST client that can be easily mocked in tests and manages connection setup and teardown behavior internally

func NewRestClient

func NewRestClient(url string, headers map[string]string) Client

NewRestClient creates a Client.

type FrameSorter

type FrameSorter struct {
	// contains filtered or unexported fields
}

FrameSorter sorts a DataFrame by field.

func NewFrameSorter

func NewFrameSorter(frame *data.Frame, sortField *data.Field) FrameSorter

NewFrameSorter returns a new frameSorter.

func (FrameSorter) Len

func (fs FrameSorter) Len() int

func (FrameSorter) Less

func (fs FrameSorter) Less(i, j int) bool

func (FrameSorter) Swap

func (fs FrameSorter) Swap(i, j int)

Jump to

Keyboard shortcuts

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