modulegen

package
v0.0.0-...-4f71f7c Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceModuleString    string = "service"
	RepositoryModuleString string = "repository"
	ProtocolModuleString   string = "protocol"
	DatabaseModuleString   string = "database"
	AnyModuleString        string = "any"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ModuleDto

type ModuleDto struct {
	PackageName        string
	FileName           string
	ModuleName         string
	Path               string
	ProjectPath        string
	GomodName          string
	AddFuncArgs        *ast.FunctionArgList
	AddFuncArgToReturn *ast.FunctionReturnArgsSpec
	AddStructVarDecl   *ast.StructArgList
	AddImport          *ast.ImportSpec
}

type ModuleGen

type ModuleGen interface {
	CreateNewModule(dto ModuleDto) error
	BuildModuleTemplate(dto ModuleDto) (string, error)
}

create module, what is module all of these package is based on module. dependency in here called as a module

type ModuleGenImpl

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

func NewModuleGen

func NewModuleGen(fs database.FileSystem, wireGen wiregen.WireGen) *ModuleGenImpl

func (ModuleGenImpl) BuildModuleTemplate

func (s ModuleGenImpl) BuildModuleTemplate(dto ModuleDto) (string, error)

BuildModuleTemplate will build base file of the module, such as interface struct and the construct

func (ModuleGenImpl) CreateNewModule

func (s ModuleGenImpl) CreateNewModule(dto ModuleDto) error

CreateNewModule to create new module

type ModuleType

type ModuleType int
const (
	ServiceModule ModuleType = iota + 1
	RepositoryModule
	ProtocolModule
	DatabaseModule
	AnyModule
)

func NewModuleTypeFromString

func NewModuleTypeFromString(s string) ModuleType

func (ModuleType) ToString

func (m ModuleType) ToString() string

Jump to

Keyboard shortcuts

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