codegen

package
v3.36.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 18 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

This file renders a typed test client with one method branch for each transport selected by the Goa design.

This file assembles the generated testing package and preserves the released helper functions for applications that call the plugin directly.

This file renders the in-process servers and clients used by generated service tests for HTTP, gRPC, and JSON-RPC transports.

This file records every package, name, and import emitted by the testing plugin so Goa can report conflicts before it writes source files.

This file renders scenario runners and example scenario files from finalized Goa service data and transport choices.

This file renders the user-owned top-level suite that exercises each service method through the transports selected by the design.

This file renders valid payload builders and validation-edge examples for generated service tests.

This file converts Goa's finalized JSON-RPC plan into the small set of transport choices used by testing templates. The templates receive only the branches that the design can use, so generated tests contain no runtime transport guessing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(genpkg string, svcData *service.Data, root *expr.RootExpr, svc *expr.ServiceExpr) []*codegen.File

Generate produces testing files (client, harness, scenarios, errors, testdata) for the given service.

func GenerateExampleScenarios

func GenerateExampleScenarios(genpkg string, root *expr.RootExpr, svc *expr.ServiceExpr) *codegen.File

GenerateExampleScenarios returns an example scenarios.yaml file.

func GenerateExampleScenariosFromData added in v3.31.0

func GenerateExampleScenariosFromData(genpkg string, svcData *service.Data, root *expr.RootExpr, svc *expr.ServiceExpr) *codegen.File

GenerateExampleScenariosFromData returns an example scenarios.yaml file from service values already finalized by a Goa service plan.

func GeneratePlanned added in v3.31.0

func GeneratePlanned(genpkg string, svcData *service.Data, root *expr.RootExpr, svc *expr.ServiceExpr, jsonPlan *jsonrpccodegen.Plan) []*codegen.File

GeneratePlanned produces testing files from the service and JSON-RPC values finalized by the current Goa generation run.

func GeneratePlannedExampleScenarios added in v3.31.0

func GeneratePlannedExampleScenarios(genpkg string, svcData *service.Data, root *expr.RootExpr, svc *expr.ServiceExpr, jsonPlan *jsonrpccodegen.Plan) *codegen.File

GeneratePlannedExampleScenarios returns example scenarios using the transport choices finalized by the current Goa generation run.

func GeneratePlannedSuiteTopLevel added in v3.31.0

func GeneratePlannedSuiteTopLevel(genpkg, examplePkg string, svcData *service.Data, root *expr.RootExpr, svc *expr.ServiceExpr, jsonPlan *jsonrpccodegen.Plan) *codegen.File

GeneratePlannedSuiteTopLevel returns an example suite using the transport choices finalized by the current Goa generation run.

func GenerateSuiteTopLevel

func GenerateSuiteTopLevel(genpkg, examplePkg string, root *expr.RootExpr, svc *expr.ServiceExpr) *codegen.File

GenerateSuiteTopLevel returns the top-level example suite file.

func GenerateSuiteTopLevelFromData added in v3.31.0

func GenerateSuiteTopLevelFromData(genpkg, examplePkg string, svcData *service.Data, root *expr.RootExpr, svc *expr.ServiceExpr) *codegen.File

GenerateSuiteTopLevelFromData returns the top-level example suite from service values already finalized by a Goa service plan.

func PlanPackage added in v3.31.0

func PlanPackage(
	generation *codegen.Generation,
	servicePlan *service.Plan,
	root *expr.RootExpr,
	svc *expr.ServiceExpr,
) error

PlanPackage records the package, imports, and fixed Go names emitted for one service test helper package. Public names stay fixed because applications refer to them from handwritten tests.

Types

type ValidatorInfo

type ValidatorInfo struct {
	Validators map[string][]string // method -> validator names
	Package    string              // package name containing validators
	Path       string              // import path for the package
}

ValidatorInfo holds validator configuration

func ExtractValidatorsFromYAML

func ExtractValidatorsFromYAML() ValidatorInfo

ExtractValidatorsFromYAML reads scenarios.yaml if it exists and extracts validator names and package

Jump to

Keyboard shortcuts

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