xgen

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GeneratedFilePrefix = "generated_xgen_"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option = func(xgen *Xgen) error

func WithPackageName

func WithPackageName(packageName string) Option

WithPackageName sets package name for Xgen

func WithPlugin

func WithPlugin(plugin plugins.Plugin) Option

func WithProject

func WithProject(name string, project projects.Project) Option

WithProject adds a new project to Xgen

type Xgen

type Xgen struct {
	PackageName *string                     `yaml:"package_name" json:"package_name"`
	Projects    map[string]projects.Project `yaml:"projects" json:"projects"`
	Plugins     []plugins.Plugin            `yaml:"plugin" json:"plugins"`
}

Xgen main struct

func NewXgen

func NewXgen(options ...Option) *Xgen

NewXgen creates a new Xgen instance it creates a new Xgen instance with projects and CLI

func (*Xgen) Generate

func (x *Xgen) Generate(ctx context.Context) (err error)

Generate generates code it is a main function of Xgen it generates code for projects and CLI

Jump to

Keyboard shortcuts

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