option

package
v0.0.0-...-2611440 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2021 License: MIT, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CmdDirTokens = []string{"pkg", "cmd"}
View Source
var (
	EndpointDirTokens = []string{"pkg", "endpoint"}
)

Functions

func GetDir

func GetDir(rootDir string, dirType DirType) string

func GetProjectDirs

func GetProjectDirs(rootDir string) map[DirType]string

GetProjectDirs get default project dir

Types

type ClientOption

type ClientOption struct {
	Dir string
}

type CmdOption

type CmdOption struct {
	Dir string
}

func NewCmdOption

func NewCmdOption(svcName string) *CmdOption

type DirType

type DirType int
const (
	Binary DirType
	Proto
	Service
	Pb
	Grpc
	Http
)

type EndpointOption

type EndpointOption struct {
	Dir string
}

func NewEndpointOption

func NewEndpointOption(svcName string) *EndpointOption

func (EndpointOption) GetName

func (e EndpointOption) GetName() string

type GenerateOption

type GenerateOption struct {
	RootDir string
	Service *ServiceOption // service generating options
	Grpc    *GrpcOption
	Cmd     *CmdOption    // cmd generating options
	Client  *ClientOption // client generating options
	Main    *MainOption   // main.go file option
}

func GetAllOption

func GetAllOption(rootDir string) *GenerateOption

type GrpcOption

type GrpcOption struct {
	Root       string
	Dir        string
	PbDir      string
	ServiceDir string
}

func NewGrpcOption

func NewGrpcOption(rootDir string) *GrpcOption

func (*GrpcOption) GetName

func (e *GrpcOption) GetName() string

type MainOption

type MainOption struct {
	Root    string
	Dir     string
	SvcDir  string // service files generating dir
	GrpcDir string
	PbDir   string
}

func NewMainOption

func NewMainOption(rootDir string) *MainOption

type Optioner

type Optioner interface {
	GetName() string
}

type ServiceMeta

type ServiceMeta struct {
	RawSvcName       string
	SvcInterfaceName string
	SvcStructName    string
	SvcInterface     *parser.Interface
}

func GetServiceMeta

func GetServiceMeta(rootDir string) (*ServiceMeta, error)

type ServiceOption

type ServiceOption struct {
	Root  string
	Dir   string // service files generating dir
	PbDir string
}

func NewServiceOption

func NewServiceOption(rootDir string) *ServiceOption

Jump to

Keyboard shortcuts

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