report

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyDashboard = errors.New("empty dashboard model")

Functions

This section is empty.

Types

type Options

type Options struct {
	DashUID     string
	Layout      string
	Orientation string
	TimeRange   dashboard.TimeRange
}

Options contains Report options.

type PDF

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

PDF represents a PDF report.

func New

func New(logger log.Logger, conf config.Config, chromeInstance chrome.Instance, workerPools worker.Pools, client client.Grafana, options *Options) (*PDF, error)

New creates a new PDF struct.

func (*PDF) Generate

func (r *PDF) Generate(ctx context.Context, writer io.Writer) error

Generate returns the PDF.pdf file. After reading this file, it should be Closed() After closing the file, call PDF.Clean() to delete the file as well the temporary build files.

func (*PDF) Title

func (r *PDF) Title() string

Title returns the dashboard title parsed from the dashboard definition.

type Report

type Report interface {
	Generate(ctx context.Context) ([]byte, error)
}

Report groups functions related to genrating the PDF.

Jump to

Keyboard shortcuts

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