generator

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 7 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 {
	// contains filtered or unexported fields
}

func InitializeGenerator

func InitializeGenerator() *Generator

func (*Generator) GenerateAFOP

func (g *Generator) GenerateAFOP(pkgName string, structName string, sts []*StructField) (string, error)

GenerateAFOP is the function to generate code of Applicable Functional Option Pattern from struct

func (*Generator) GenerateAFOPWithoutNew

func (g *Generator) GenerateAFOPWithoutNew(pkgName string, structName string, sts []*StructField) (string, error)

GenerateAFOPWithoutNew is the function to generate code of Applicable Functional Option Pattern from struct

func (*Generator) GenerateFOP

func (g *Generator) GenerateFOP(pkgName string, structName string, sts []*StructField) (string, error)

GenerateFOP is the function to generate code of Functional Option Pattern from struct

func (*Generator) GenerateFOPWithoutNew

func (g *Generator) GenerateFOPWithoutNew(pkgName string, structName string, sts []*StructField) (string, error)

GenerateFOPWithoutNew is the function to generate code of Functional Option Pattern from struct

type StructField

type StructField struct {
	// Name is field name in the structure
	Name string
	// Type is type of field in the structure
	Type string
	// Ignore is the flag to exclude 'Functional Optional Pattern' from the automatic generation target
	Ignore bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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