mockgen

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	// HeaderFile specifies the header text (e.g. license) to prepend to generated files.
	HeaderFile string `marker:",optional"`

	// Year specifies the year to substitute for " YEAR" in the header file.
	Year string `marker:",optional"`
}

Generator generates a Go kit Endpoint for a service.

func (Generator) CheckFilter added in v0.5.0

func (Generator) CheckFilter() loader.NodeFilter

func (Generator) Generate

func (g Generator) Generate(ctx *genall.GenerationContext) error

func (Generator) RegisterMarkers

func (g Generator) RegisterMarkers(into *markers.Registry) error

type Marker

type Marker struct {
	// TestOnly tells the generator to write the generated mock in a test file.
	TestOnly bool `marker:"testOnly,optional"`

	// External tells the generator to write the generated mock in an "external" test package
	// (package name suffixed with _test).
	// External also implies TestOnly, but setting both values will generate the mock twice:
	// once in the same package in a test file, once in an external package.
	External bool `marker:"external,optional"`
}

Marker enables generating a mock for an interface and provides information to the generator.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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