chart

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Methods added in v0.4.0

func Methods() []string

Methods returns module methods

func ModuleName added in v0.4.0

func ModuleName() string

ModuleName returns the module name

Types

type Chart

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

Chart represent Chart core module

func New

func New(logger *zap.Logger) *Chart

New creates new Chart core module

func (*Chart) CoreApiHandler added in v0.10.0

func (ch *Chart) CoreApiHandler(method string, parts []string, params map[string]string, body []byte) (any, int, error)

func (*Chart) GetLoader

func (ch *Chart) GetLoader(_ modules.Job) lua.LGFunction

GetLoader returns the lua loader

func (*Chart) Name

func (ch *Chart) Name() string

Name returns the module name

func (*Chart) Render

func (ch *Chart) Render(title string, data *Data, w io.Writer) error

Render the chart to the writer

func (*Chart) Stop

func (ch *Chart) Stop() error

Stop the module

type Data

type Data struct {
	Title  string
	Series []DataSeries
}

Data represents chart data

type DataItem

type DataItem struct {
	Timestamp float64 `json:"timestamp"`
	Value     float64 `json:"value"`
}

DataItem represents data item

type DataSeries

type DataSeries struct {
	Color      string     `json:"color"`
	LineColor  string     `json:"line_color"`
	PointColor string     `json:"point_color"`
	Data       []DataItem `json:"data"`
}

DataSeries represents data series

Jump to

Keyboard shortcuts

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