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

meta

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 7 Imported by: 26

Documentation

Index

Constants

View Source
const (
	CmdUpdate = "update"
	CmdNew    = "new"
	CmdModel  = "model"
	CmdClient = "client"
)

hz Commands

View Source
const (
	IdlThrift = "thrift"
	IdlProto  = "proto"
)

hz IDLs

View Source
const (
	TpCompilerThrift = "thriftgo"
	TpCompilerProto  = "protoc"
)

Third-party Compilers

View Source
const (
	ProtocPluginName = "protoc-gen-hertz"
	ThriftPluginName = "thrift-gen-hertz"
)

hz Plugins

View Source
const (
	LoadError           = 1
	GenerateLayoutError = 2
	PersistError        = 3
	PluginError         = 4
)

hz Errors

View Source
const (
	ModelDir   = "biz" + string(filepath.Separator) + "model"
	RouterDir  = "biz" + string(filepath.Separator) + "router"
	HandlerDir = "biz" + string(filepath.Separator) + "handler"
)

Package Dir

View Source
const AddThriftReplace = "do not generate 'go.mod', please add 'replace github.com/apache/thrift => github.com/apache/thrift v0.13.0' to your 'go.mod'"
View Source
const DefaultServiceName = "hertz_service"
View Source
const EnvPluginMode = "HERTZ_PLUGIN_MODE"
View Source
const ManifestFile = ".hz"

ManifestFile is the project metadata file created by "hz new". It records the hz version and directory layout so "hz update" can locate generated files.

View Source
const (
	SetBodyParam = "setBodyParam(req).\n"
)

template const value

View Source
const SysType = runtime.GOOS

SysType is the running program's operating system type

View Source
const TheUseOptionMessage = "'model code' is not generated due to the '-use' option"

TheUseOptionMessage indicates that the generating of 'model code' is aborted due to the -use option for thrift IDL.

View Source
const Version = "v0.9.8"

Version hz version

View Source
const WindowsOS = "windows"

Variables

View Source
var GoVersion *gv.Version

Functions

This section is empty.

Types

type Backend

type Backend string

Backend Model Backends

const (
	BackendGolang Backend = "golang"
)

type Manifest

type Manifest struct {
	Version    string `yaml:"hz version"` // hz version that created/updated this project
	HandlerDir string `yaml:"handlerDir"` // custom handler directory (empty = default)
	ModelDir   string `yaml:"modelDir"`   // custom model directory (empty = default)
	RouterDir  string `yaml:"routerDir"`  // custom router directory (empty = default)
}

Manifest represents the contents of the .hz project metadata file.

func (*Manifest) InitAndValidate added in v0.6.0

func (manifest *Manifest) InitAndValidate(dir string) error

InitAndValidate loads the .hz manifest from dir and validates it belongs to a hertz project.

func (*Manifest) Persist

func (manifest *Manifest) Persist(dir string) error

func (*Manifest) String

func (manifest *Manifest) String() string

type Mode

type Mode int

Mode hz run modes

Jump to

Keyboard shortcuts

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