package generator
Import Path
/tools/generator (on go.dev)
Dependency Relation
imports 27 packages, and imported by 3 packages
Involved Source Files
grafana.go
Package generator generates state-machine schemas and grafana dashboards.
starter.go
Package-Level Type Names (total 2)
Global bool
Groups []string
Mach *am.Machine
N is the first letter of Name
Name string
State1 -> Rel -> State2,State3
StateTags map[string][]string
States []string
StatesAuto []string
StatesMulti []string
(*SchemaGenerator) GroupsEnter(e *am.Event) bool
(*SchemaGenerator) InheritEnter(e *am.Event) bool
Output renders the generated schema file using github.com/dave/jennifer.
func NewSchemaGenerator(ctx context.Context, param cli.SchemaParams) (*SchemaGenerator, error)
SyncTracer is [am.Tracer] for tracing new submachines and syncing the Grafana
dashboard.
TracerNoOp *am.TracerNoOp
TracerNoOp.Id string
( SyncTracer) HandlerEnd(transition *machine.Transition, emitter string, handler string)
( SyncTracer) HandlerStart(transition *machine.Transition, emitter string, handler string)
( SyncTracer) Inheritable() bool
( SyncTracer) MachineDispose(machID string)
(*SyncTracer) MachineInit(mach am.Api) context.Context
( SyncTracer) MutationQueued(machine machine.Api, mutation *machine.Mutation)
(*SyncTracer) NewSubmachine(parent, mach am.Api)
( SyncTracer) QueueEnd(machine machine.Api)
( SyncTracer) SchemaChange(machine machine.Api, old machine.Schema)
(*SyncTracer) TracerId() string
( SyncTracer) TransitionEnd(transition *machine.Transition)
( SyncTracer) TransitionFinals(transition *machine.Transition)
( SyncTracer) TransitionInit(transition *machine.Transition)
( SyncTracer) TransitionStart(transition *machine.Transition)
( SyncTracer) VerifyStates(machine machine.Api)
*SyncTracer : github.com/pancsta/asyncmachine-go/pkg/machine.Tracer
Package-Level Functions (total 8)
func GenDashboard(p cli.GrafanaParams) (*dashboard.Builder, error)
GenStarterFiles generates all file contents for a starter kit project
without writing them to disk. Returns a map of relative file path -> content.
GenStarterKit writes all starter files to disk.
func GenUtilsFile() string
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 NewSchemaGenerator(ctx context.Context, param cli.SchemaParams) (*SchemaGenerator, error)
SchemaFileToParams reads the YAML schema file specified in params and
converts it to StatesParams.
func SyncDashboard(ctx context.Context, p cli.GrafanaParams, builder *dashboard.Builder) error
![]() |
The pages are generated with Golds v0.8.4. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |