generator

package
v2.1.5 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package generator generates the testify public API.

It adapts the internal testify API from github.com/go-openapi/testify/v2/internal/assertions and generates the content in packages "assert" and "require".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DocGenerator

type DocGenerator struct {
	// contains filtered or unexported fields
}

func NewDocGenerator

func NewDocGenerator(doc model.Documentation, opts ...Option) *DocGenerator

func (*DocGenerator) Generate

func (d *DocGenerator) Generate(opts ...GenerateOption) error

type GenerateOption

type GenerateOption func(*generateOptions)

GenerateOption is an option for code generation.

func WithIncludeDoc

func WithIncludeDoc(enabled bool) GenerateOption

func WithIncludeExamples

func WithIncludeExamples(enabled bool) GenerateOption

func WithIncludeFormatFuncs

func WithIncludeFormatFuncs(enabled bool) GenerateOption

func WithIncludeForwardFuncs

func WithIncludeForwardFuncs(enabled bool) GenerateOption

func WithIncludeGenerics

func WithIncludeGenerics(enabled bool) GenerateOption

func WithIncludeHelpers

func WithIncludeHelpers(enabled bool) GenerateOption

func WithIncludeTests

func WithIncludeTests(enabled bool) GenerateOption

func WithRunnableExamples

func WithRunnableExamples(enabled bool) GenerateOption

func WithTargetDoc

func WithTargetDoc(dir string) GenerateOption

func WithTargetPackage

func WithTargetPackage(pkg string) GenerateOption

func WithTargetRoot

func WithTargetRoot(dir string) GenerateOption

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator generates testify packages (assert, require) from the internal assertions package.

func New

func New(source *model.AssertionPackage, opts ...Option) *Generator

func (*Generator) Documentation

func (g *Generator) Documentation() model.Documentation

Documentation yields the transformed package model as a model.Documentation usable by a generation step by the DocGenerator.

func (*Generator) Generate

func (g *Generator) Generate(opts ...GenerateOption) error

type Option

type Option func(*options)

Option is a general option for the generator.

Currently unused (reserved for future use).

Directories

Path Synopsis
Package domains provides domain-based organization of assertions for documentation generation.
Package domains provides domain-based organization of assertions for documentation generation.
Package funcmaps provides template functions for code and documentation generation.
Package funcmaps provides template functions for code and documentation generation.

Jump to

Keyboard shortcuts

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