generator

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 21 Imported by: 1

Documentation

Overview

Package generator generates state-machine schemas and grafana dashboards.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenDashboard added in v0.8.0

func GenDashboard(p cli.GrafanaParams) (*dashboard.Builder, error)

func GenUtilsFile added in v0.8.0

func GenUtilsFile() string

func MachDashboardEnv added in v0.10.3

func MachDashboardEnv(mach *am.Machine) error

MachDashboardEnv binds a Grafana dashboard generator to the [mach], based on environment variables: - AM_GRAFANA_URL: the Grafana URL - AM_GRAFANA_TOKEN: the Grafana API token - AM_SERVICE: the service name

This tracer is inherited by submachines, and this function applies only to top-level machines.

func SyncDashboard added in v0.8.0

func SyncDashboard(
	ctx context.Context, p cli.GrafanaParams, builder *dashboard.Builder,
) error

Types

type SchemaGenerator added in v0.16.0

type SchemaGenerator struct {
	Mach *am.Machine

	Name string
	// N is the first letter of Name
	N           string
	States      []string
	StatesAuto  []string
	StatesMulti []string
	Groups      []string
	// State1 -> Rel -> State2,State3
	Relations [][3]string
}

func NewSchemaGenerator added in v0.16.0

func NewSchemaGenerator(
	ctx context.Context, param cli.SFParams,
) (*SchemaGenerator, error)

func (*SchemaGenerator) GroupsEnter added in v0.16.0

func (g *SchemaGenerator) GroupsEnter(e *am.Event) bool

func (*SchemaGenerator) InheritEnter added in v0.16.0

func (g *SchemaGenerator) InheritEnter(e *am.Event) bool

func (*SchemaGenerator) Output added in v0.16.0

func (g *SchemaGenerator) Output() string

type SyncTracer added in v0.10.3

type SyncTracer struct {
	*am.TracerNoOp
	// contains filtered or unexported fields
}

SyncTracer is am.Tracer for tracing new submachines and syncing the Grafana dashboard.

func (*SyncTracer) MachineInit added in v0.10.3

func (t *SyncTracer) MachineInit(mach am.Api) context.Context

func (*SyncTracer) NewSubmachine added in v0.10.3

func (t *SyncTracer) NewSubmachine(parent, mach am.Api)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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