generate

package
v0.0.0-...-9806ac5 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(cfg Config) ([]byte, error)

Generate executes the option generation template and return sthe resulting bytes or an error.

Types

type Config

type Config struct {
	GenerateCmd  string
	Package      string
	Singular     string
	Plural       string
	Source       string
	OptionPrefix string
	Options      []Option
	WithBuilder  bool
	NoPkgOptions bool
}

Config defines template configuration.

type Option

type Option struct {
	IsSlice bool
	Name    string
	Type    string
	Field   string
}

Option defines a functional option to generate.

Jump to

Keyboard shortcuts

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