create

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNameEmpty       = errors.New(`please provide the name using "-name" option`)
	ErrInvalidType     = errors.New("invalid create type")
	ErrNoProjectName   = errors.New("cannot determine project name, ensure go.mod exists")
	ErrCreateFile      = errors.New("failed to create file")
	ErrExecuteTemplate = errors.New("failed to execute template")
)

Functions

func All

func All(ctx *kite.Context) (any, error)

All creates handler, service, repository, and model files.

func GetTemplate

func GetTemplate(createType string) string

GetTemplate returns the template content for the given type.

func Handler

func Handler(ctx *kite.Context) (any, error)

Handler creates a new handler file.

func Model

func Model(ctx *kite.Context) (any, error)

Model creates a new model file.

func Repository

func Repository(ctx *kite.Context) (any, error)

Repository creates a new repository file.

func Service

func Service(ctx *kite.Context) (any, error)

Service creates a new service file.

Types

type CreateData

type CreateData struct {
	ProjectName          string
	CreateType           string
	FilePath             string
	FileName             string
	StructName           string
	StructNameLowerFirst string
	StructNameSnakeCase  string
}

CreateData holds the data structure for template execution.

Jump to

Keyboard shortcuts

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