libStarter

package
v0.0.0-...-480cc5f Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const StarterCodeTemplate = `` /* 1314-byte string literal not displayed */
View Source
const StarterConfigCodeTemplate = `package {{ .PackageName }}

type Config struct {
	
}

func DefaultConfig() *Config {
	return &Config{
		
	}
}

`
View Source
const StarterReadmeCodeTemplate = `` /* 158-byte string literal not displayed */
View Source
const StarterTestingCodeTemplate = `` /* 506-byte string literal not displayed */
View Source
const StarterXCodeTemplate = `package {{ .PackageName }}

// 可供外部调用的运行实例

func X() {

	return
}

`

Variables

This section is empty.

Functions

This section is empty.

Types

type CmdParams

type CmdParams struct {
	Name       string `json:"name"`
	OutputPath string `json:"output_path"`
}

type FormatterStarter

type FormatterStarter struct {
	FormatterStruct
}

func NewFormatterStarter

func NewFormatterStarter() *FormatterStarter

func (*FormatterStarter) Format

func (f *FormatterStarter) Format(cmdParams *CmdParams) IFormatter

func (*FormatterStarter) WriteOut

func (f *FormatterStarter) WriteOut(writer io.Writer) error

type FormatterStarterConfig

type FormatterStarterConfig struct {
	FormatterStruct
}

func NewFormatterStarterConfig

func NewFormatterStarterConfig() *FormatterStarterConfig

func (*FormatterStarterConfig) Format

func (f *FormatterStarterConfig) Format(cmdParams *CmdParams) IFormatter

func (*FormatterStarterConfig) WriteOut

func (f *FormatterStarterConfig) WriteOut(writer io.Writer) error

type FormatterStarterReadme

type FormatterStarterReadme struct {
	FormatterStruct
}

func NewFormatterStarterReadme

func NewFormatterStarterReadme() *FormatterStarterReadme

func (*FormatterStarterReadme) Format

func (f *FormatterStarterReadme) Format(cmdParams *CmdParams) IFormatter

func (*FormatterStarterReadme) WriteOut

func (f *FormatterStarterReadme) WriteOut(writer io.Writer) error

type FormatterStarterTesting

type FormatterStarterTesting struct {
	FormatterStruct
}

func NewFormatterStarterTesting

func NewFormatterStarterTesting() *FormatterStarterTesting

func (*FormatterStarterTesting) Format

func (f *FormatterStarterTesting) Format(cmdParams *CmdParams) IFormatter

func (*FormatterStarterTesting) WriteOut

func (f *FormatterStarterTesting) WriteOut(writer io.Writer) error

type FormatterStarterX

type FormatterStarterX struct {
	FormatterStruct
}

func NewFormatterStarterX

func NewFormatterStarterX() *FormatterStarterX

func (*FormatterStarterX) Format

func (f *FormatterStarterX) Format(cmdParams *CmdParams) IFormatter

func (*FormatterStarterX) WriteOut

func (f *FormatterStarterX) WriteOut(writer io.Writer) error

type FormatterStruct

type FormatterStruct struct {
	PackageName string
	ImportList  map[string]ImportItem
	Name        string
	StructName  string
	TypeName    string
}

格式化信息结构体

type IFormatter

type IFormatter interface {
	Format(cmdParams *CmdParams) IFormatter
	WriteOut(writer io.Writer) error
}

type ImportItem

type ImportItem struct {
	Alias   string
	Package string
}

Jump to

Keyboard shortcuts

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