report

package
v3.116.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExportTargetDir = env.String("CODEGEN_REPORT_DIR",
	"The directory to generate a codegen report in")

Functions

This section is empty.

Types

type File

type File struct {
	Name string `json:"name,omitempty"`
	Body string `json:"body,omitempty"`
}

type GenerateProgramFn

type GenerateProgramFn func(*hcl2.Program) (map[string][]byte, hcl.Diagnostics, error)

func WrapGen

func WrapGen(reporter Reporter, title, language string, files []*syntax.File, f GenerateProgramFn) GenerateProgramFn

type Language

type Language struct {
	Stats

	// A mapping from Error:(title:occurrences)
	Warnings map[string]map[string]int `json:"warning,omitempty"`
	Errors   map[string]map[string]int `json:"errors,omitempty"`

	// A mapping from between titles and Go errors (as opposed to diag errors)
	GoErrors map[string]string `json:"goerrors,omitempty"`

	// A mapping from title:files
	Files map[string][]File `json:"files,omitempty"`
}

type Reporter

type Reporter interface {
	io.Closer
	// Report a call to GenerateProgram.
	Report(title, language string, files []*syntax.File, diags hcl.Diagnostics, err error)
	Summary() Summary
}

func New

func New(name, version string) Reporter

type Stats

type Stats struct {
	NumConversions int
	Successes      int
}

type Summary

type Summary struct {
	Stats
	Name          string               `json:"name"`
	Version       string               `json:"version"`
	ReportVersion string               `json:"reportVersion"`
	Languages     map[string]*Language `json:"languages"`
}

Jump to

Keyboard shortcuts

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