options

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPluginCmd

func BuildPluginCmd(opt *Option) (*exec.Cmd, error)

func IdlTypeToCompiler

func IdlTypeToCompiler(idlType string) (string, error)

Types

type Option

type Option struct {
	// Mode              meta.Mode // operating mode(0-compiler, 1-plugin)
	ServiceGroup   string
	CmdType        string // command type
	Verbose        bool   // print verbose log
	Cwd            string // execution path
	OutDir         string // output path
	HandlerDir     string // handler path
	ModelDir       string // model path
	RouterDir      string // router path
	ClientDir      string // client path
	BaseDomain     string // request domain
	ForceClientDir string // client dir (not use namespace as a subpath)

	IdlType       string   // idl type
	IdlPaths      []string // master idl path
	RawOptPkg     []string // user-specified package import path
	OptPkgMap     map[string]string
	Includes      []string
	PkgPrefix     string
	TrimGoPackage string // trim go_package for protobuf, avoid to generate multiple directory

	Gopath      string // $GOPATH
	Gosrc       string // $GOPATH/src
	Gomod       string
	Gopkg       string // $GOPATH/src/{{gopkg}}
	ServiceName string // service name
	Use         string
	NeedGoMod   bool

	JSONEnumStr          bool
	QueryEnumAsInt       bool
	UnsetOmitempty       bool
	ProtobufCamelJSONTag bool
	ProtocOptions        []string // options to pass through to protoc
	ThriftOptions        []string // options to pass through to thriftgo for go flag
	ProtobufPlugins      []string
	ThriftPlugins        []string
	SnakeName            bool
	RmTags               []string
	Excludes             []string
	NoRecurse            bool
	HandlerByMethod      bool
	ForceNew             bool
	ForceUpdateClient    bool
	SnakeStyleMiddleware bool
	EnableExtends        bool
	SortRouter           bool

	CustomizeLayout     string
	CustomizeLayoutData string
	CustomizePackage    string
	ModelBackend        string
}

func NewOption

func NewOption() *Option

func (*Option) Fork

func (arg *Option) Fork() *Option

Fork can copy its own parameters to a new Option

func (*Option) GetClientDir

func (arg *Option) GetClientDir() (string, error)

func (*Option) GetGoPackage

func (arg *Option) GetGoPackage() (string, error)

func (*Option) GetHandlerDir

func (arg *Option) GetHandlerDir() (string, error)

func (*Option) GetModelDir

func (arg *Option) GetModelDir() (string, error)

func (*Option) GetRouterDir

func (arg *Option) GetRouterDir() (string, error)

func (*Option) GetThriftgoOptions

func (opt *Option) GetThriftgoOptions() (string, error)

func (*Option) InitManifest

func (arg *Option) InitManifest(m *meta.Manifest)

func (*Option) IsNew

func (arg *Option) IsNew() bool

func (*Option) IsUpdate

func (arg *Option) IsUpdate() bool

func (*Option) ModelOutDir

func (arg *Option) ModelOutDir() string

func (*Option) ModelPackagePrefix

func (arg *Option) ModelPackagePrefix() (string, error)

func (*Option) Pack

func (arg *Option) Pack() ([]string, error)

func (*Option) Parse

func (arg *Option) Parse(c *cli.Context, cmd string) (*Option, error)

Parse initializes a new Option based on its own information

func (*Option) Unpack

func (arg *Option) Unpack(data []string) error

func (*Option) UpdateByManifest

func (arg *Option) UpdateByManifest(m *meta.Manifest)

func (*Option) UpdateManifest

func (arg *Option) UpdateManifest(m *meta.Manifest)

Jump to

Keyboard shortcuts

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