wrapper

package
v0.0.0-...-7c0f2aa Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	HeaderPath    string
	GenStatement  string
	Template      string
	PackageName   string
	LinterEnabled bool
	Imports       *packages.Imports
}

func NewFile

func NewFile(pkgPath, pkgName, tmpl string, opts ...FileOption) *File

func (*File) Wrap

func (f *File) Wrap(input map[string]interface{}) ([]byte, error)

Wrap writes the objects to the file one by one.

func (*File) Write

func (f *File) Write(name string, input map[string]interface{}, perm os.FileMode) error

Write wraps the file with given input and writes it to the file system.

type FileOption

type FileOption func(*File)

func LinterEnabled

func LinterEnabled() FileOption

func WithGenStatement

func WithGenStatement(s string) FileOption

func WithHeaderPath

func WithHeaderPath(h string) FileOption

func WithImports

func WithImports(im *packages.Imports) FileOption

Jump to

Keyboard shortcuts

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