generate

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0, MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SloNameArgument    = "--slo"
	SuccessObjArgument = "--success-target"
	LatencyMsArgument  = "--latency-ms"
	LatencyObjArgument = "--latency-target"
	NoDocArgument      = "--no-doc"

	AmPromPackage = "\"github.com/autometrics-dev/autometrics-go/prometheus/autometrics\""
	AmOtelPackage = "\"github.com/autometrics-dev/autometrics-go/otel/autometrics\""
)

Variables

This section is empty.

Functions

func GenerateDocumentationAndInstrumentation

func GenerateDocumentationAndInstrumentation(ctx internal.GeneratorContext, sourceCode, moduleName string) (string, error)

GenerateDocumentationAndInstrumentation takes the raw source code from a file and generates the documentation for the `//autometrics:inst` functions.

It returns the new source code with augmented documentation.

func TransformFile

func TransformFile(ctx internal.GeneratorContext, path, moduleName string) error

TransformFile takes a file path and generates the documentation for the `//autometrics:inst` functions.

It also replaces the file in place.

Types

type GenerateError added in v0.9.0

type GenerateError struct {
	FunctionName string
	Detail       error
}

type GenerateErrors added in v0.9.0

type GenerateErrors []GenerateError

func (GenerateErrors) Error added in v0.9.0

func (errs GenerateErrors) Error() string

Jump to

Keyboard shortcuts

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