printer

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print

func Print(out io.Writer, ifaces []*token.Interface, opts ...PrintOption) error

Types

type PrintOption

type PrintOption func(ctx *context)

PrintOption is a Print+ configuration option.

func WithCamelize added in v0.2.0

func WithCamelize(enable bool) PrintOption

func WithClientOnly added in v0.2.0

func WithClientOnly(enable bool) PrintOption

WithClientOnly makes the printer generate only client-side code.

func WithGofmt

func WithGofmt(enable bool) PrintOption

WithGofmt gofmts generated code, enabled by default.

Not recommended to disable it, only for debugging the output, because gofmt works as a validation step as well.

func WithPackageName

func WithPackageName(name string) PrintOption

WithPackageName overrides the package name of generated code.

func WithPrefixes

func WithPrefixes(prefixes []string) PrintOption

WithPrefixes prefixes to strip from interface names, be careful when using it may lead to compilation errors.

func WithServerOnly added in v0.2.0

func WithServerOnly(enable bool) PrintOption

WithServerOnly makes the printer generate only server-side code.

Jump to

Keyboard shortcuts

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