endpointgen

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 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 {
	// BaseName specifies a base name for the service (other than the one automatically generated).
	//
	// When not specified falls back to base name created from the service name.
	BaseName string `marker:"baseName,optional"`

	// ModuleName can be used instead of the package name in an operation name to uniquely identify a service call.
	//
	// Falls back to the package name.
	ModuleName string `marker:"moduleName,optional"`

	// WithOpenCensus enables generating a TraceEndpoint middleware.
	WithOpenCensus bool `marker:"withOpenCensus,optional"`

	// ErrorStrategy decides whether returned errors are checked for being endpoint or service errors.
	ErrorStrategy string `marker:"errorStrategy,optional"`
}

Marker enables generating an endpoint for a service 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