generator

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Gofmt

func Gofmt(src []byte) ([]byte, error)

func Goimports

func Goimports(src []byte) ([]byte, error)

Types

type File

type File struct {
	Name    string
	Content []byte
}

func Generate

func Generate(text string, data interface{}, opts Options) (*File, error)

func (*File) MoveTo

func (f *File) MoveTo(dir string)

func (*File) Write

func (f *File) Write() error

type Formatter

type Formatter func(src []byte) ([]byte, error)

type Options

type Options struct {
	Name           string
	Funcs          template.FuncMap
	Formatted      bool
	TargetFileName string
}

type PkgInfo

type PkgInfo struct {
	CurrentPkgName    string
	EndpointPkgPrefix string
	EndpointPkgPath   string
}

Jump to

Keyboard shortcuts

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