Help us shape the future of Go! Take the 2026 Go Developer Survey

new

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Action

func Action(ctx context.Context, c *cli.Command) error

Action 创建新项目或向现有项目添加服务的命令处理函数

Types

type ProjectDetector

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

ProjectDetector 项目结构检测器

func NewProjectDetector

func NewProjectDetector(projectPath string) *ProjectDetector

NewProjectDetector 创建项目检测器

func (*ProjectDetector) DetectServices

func (pd *ProjectDetector) DetectServices() (*ProjectServices, error)

DetectServices 检测现有服务类型

func (*ProjectDetector) GetProjectInfo

func (pd *ProjectDetector) GetProjectInfo() (*entity.Project, error)

GetProjectInfo 获取项目信息

type ProjectServices

type ProjectServices struct {
	Web  bool
	Grpc bool
	Cron bool
}

ProjectServices 项目服务检测结果

func (*ProjectServices) HasCron

func (ps *ProjectServices) HasCron() bool

HasCron 检查是否有Cron服务

func (*ProjectServices) HasGrpc

func (ps *ProjectServices) HasGrpc() bool

HasGrpc 检查是否有gRPC服务

func (*ProjectServices) HasWeb

func (ps *ProjectServices) HasWeb() bool

HasWeb 检查是否有Web服务

type ServiceGenerator

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

ServiceGenerator 服务生成器

func NewServiceGenerator

func NewServiceGenerator(projectPath string, projectInfo *entity.Project) *ServiceGenerator

NewServiceGenerator 创建服务生成器

func (*ServiceGenerator) AddService

func (sg *ServiceGenerator) AddService(serviceType string, verbose bool) error

AddService 添加指定类型的服务

Jump to

Keyboard shortcuts

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