gen

package
v0.0.0-...-2cadf5c Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ComponentGoMod       = "go_mod"
	ComponentGoMain      = "go_main"
	ComponentConfig      = "config"
	ComponentParams      = "params"
	ComponentService     = "service"
	ComponentServer      = "server"
	ComponentGrpcServer  = "grpc_server"
	ComponentGrpcHandler = "grpc_handler"
	ComponentGrpcSDK     = "grpc_sdk"
	ComponentHttpServer  = "http_server"
	ComponentHttpHandler = "http_handler"
)

Variables

This section is empty.

Functions

func RegisterComponent

func RegisterComponent(name string, com Component)

Types

type Component

type Component interface {
	Setup(plugin *protogen.Plugin)
	Generate(config helper.GenerateConfig)
}

func GetComponent

func GetComponent(name string) (Component, bool)

type Option

type Option func(options *genOptions)

func WithComponents

func WithComponents(components []string) Option

func WithModPath

func WithModPath(modPath string) Option

func WithPbGoDir

func WithPbGoDir(pbGoDir string) Option

func WithProject

func WithProject(project string) Option

type ProjectGenerator

type ProjectGenerator struct {
	// contains filtered or unexported fields
}

func NewProjectGenerator

func NewProjectGenerator(plugin *protogen.Plugin) *ProjectGenerator

func (*ProjectGenerator) Generate

func (g *ProjectGenerator) Generate(opts ...Option)

Directories

Path Synopsis
component
dto
sdk
srv

Jump to

Keyboard shortcuts

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