config

package
v0.0.0-...-3cb572a Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPluginCmd

func BuildPluginCmd(args *Argument) (*exec.Cmd, error)

func IdlTypeToCompiler

func IdlTypeToCompiler(idlType string) (string, error)

Types

type Argument

type Argument struct {
	// Mode              meta.Mode // operating mode(0-compiler, 1-plugin)
	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 NewArgument

func NewArgument() *Argument

func (*Argument) Fork

func (arg *Argument) Fork() *Argument

Fork can copy its own parameters to a new argument

func (*Argument) GetClientDir

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

func (*Argument) GetGoPackage

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

func (*Argument) GetHandlerDir

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

func (*Argument) GetModelDir

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

func (*Argument) GetRouterDir

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

func (*Argument) GetThriftgoOptions

func (arg *Argument) GetThriftgoOptions() (string, error)

func (*Argument) GetUse

func (arg *Argument) GetUse() string

func (*Argument) InitManifest

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

func (*Argument) IsNew

func (arg *Argument) IsNew() bool

func (*Argument) IsUpdate

func (arg *Argument) IsUpdate() bool

func (*Argument) ModelOutDir

func (arg *Argument) ModelOutDir() string

func (*Argument) ModelPackagePrefix

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

func (*Argument) Pack

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

func (*Argument) Parse

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

Parse initializes a new argument based on its own information

func (*Argument) Unpack

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

func (*Argument) UpdateByManifest

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

func (*Argument) UpdateManifest

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

Jump to

Keyboard shortcuts

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