file

package
v0.0.0-...-375f64e Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiFile

type ApiFile struct {
	ApiPath             string
	ApiDetailPath       string
	ApiDelAndStatusPath string
	ApiEditPath         string
	ApiListPath         string
}

func (*ApiFile) AliPath

func (a *ApiFile) AliPath(create *FileCreate) error

func (*ApiFile) ApiDelAndStatus

func (a *ApiFile) ApiDelAndStatus(create *FileCreate) error

func (*ApiFile) ApiDetail

func (a *ApiFile) ApiDetail(create *FileCreate) error

func (*ApiFile) ApiEdit

func (a *ApiFile) ApiEdit(create *FileCreate) error

func (*ApiFile) ApiFileInit

func (a *ApiFile) ApiFileInit(create *FileCreate)

func (*ApiFile) ApiList

func (a *ApiFile) ApiList(create *FileCreate) error

func (*ApiFile) SetInit

func (a *ApiFile) SetInit(create *FileCreate)

type ApiTemp

type ApiTemp struct {
	ApiPath            string
	ApiDelOrStatusPath string
	ApiDetailPath      string
	ApiEditPath        string
	ApiListPath        string
}

func (*ApiTemp) ApiTempInit

func (a *ApiTemp) ApiTempInit(create *FileCreate)

type BaseFile

type BaseFile struct {
	CreatePath
	FilePath
	ModelsPath
}

func (*BaseFile) BaseFileInit

func (b *BaseFile) BaseFileInit(ModelName, ProjectName string)

func (*BaseFile) CreateInit

func (b *BaseFile) CreateInit()

func (*BaseFile) CreateMutiDir

func (b *BaseFile) CreateMutiDir(filePath string) error

调用os.MkdirAll递归创建文件夹

func (*BaseFile) ModelsPathInit

func (b *BaseFile) ModelsPathInit()

type Buffer

type Buffer struct {
	*bytes.Buffer
}

内嵌bytes.Buffer,支持连写

func NewBuffer

func NewBuffer() *Buffer

func (*Buffer) Append

func (b *Buffer) Append(i interface{}) *Buffer

type CreatePath

type CreatePath struct {
	ModelName     string
	BasePath      string
	ApiPath       string
	RequestPath   string
	ServicePath   string
	ModelPath     string
	RouterPath    string
	MigrationPath string
}

type FileCreate

type FileCreate struct {
	ModelName    string
	TempBasePath string
	GoModPath    string
	ProjectName  string
	BaseFile
	TempFile
	ModelFile
	ServiceFile
	RequestFile
	ApiFile
	RouterFile
}

func (*FileCreate) FileCreate

func (f *FileCreate) FileCreate()

func (*FileCreate) FileCreateInit

func (f *FileCreate) FileCreateInit()

type FileNameChange

type FileNameChange struct {
}

func (FileNameChange) Camel2Case

func (FileNameChange) Camel2Case(name string) string

驼峰式写法转为下划线写法

func (FileNameChange) Case2Camel

func (FileNameChange) Case2Camel(name string) string

下划线写法转为驼峰写法

func (FileNameChange) Lcfirst

func (FileNameChange) Lcfirst(str string) string

首字母小写

func (FileNameChange) Ucfirst

func (FileNameChange) Ucfirst(str string) string

首字母大写

type FilePath

type FilePath struct {
	ApiFilePath       string
	RequestFilePath   string
	ServiceFilePath   string
	ModelFilePath     string
	RouterFilePath    string
	MigrationFilePath string
}

type ModelFile

type ModelFile struct {
}

func (*ModelFile) CreateModel

func (m *ModelFile) CreateModel(create *FileCreate) error

type ModelTemp

type ModelTemp struct {
	ModelTempPath string
}

func (*ModelTemp) ModelTempInit

func (m *ModelTemp) ModelTempInit(basePath string)

type ModelsPath

type ModelsPath struct {
	ApiModelPath       string
	RequestModelPath   string
	ServiceModelPath   string
	ModelsPath         string
	RouterModelPath    string
	MigrationModelPath string
}

type RequestFile

type RequestFile struct {
	RequestList string //实体页面

}

func (*RequestFile) CreateRequestList

func (r *RequestFile) CreateRequestList(create *FileCreate) error

func (*RequestFile) RequestFileInit

func (r *RequestFile) RequestFileInit(create *FileCreate)

func (*RequestFile) SetInit

func (r *RequestFile) SetInit(create *FileCreate)

type RequestTemp

type RequestTemp struct {
	RequestPath string
}

func (*RequestTemp) RequestTempInit

func (s *RequestTemp) RequestTempInit(create *FileCreate)

type RouterFile

type RouterFile struct {
	RouterPath    string
	RouterApiPath string
}

func (*RouterFile) CreateApi

func (r *RouterFile) CreateApi(create *FileCreate) error

func (RouterFile) PathExists

func (RouterFile) PathExists(path string) (bool, error)

func (*RouterFile) RouterApi

func (r *RouterFile) RouterApi(create *FileCreate) error

func (*RouterFile) RouterFileInit

func (r *RouterFile) RouterFileInit(create *FileCreate)

func (*RouterFile) RouterFilePath

func (r *RouterFile) RouterFilePath(create *FileCreate) error

func (*RouterFile) SetInit

func (r *RouterFile) SetInit(create *FileCreate)

type RouterTemp

type RouterTemp struct {
	RouterPath    string
	RouterApiPath string
}

func (*RouterTemp) RouterTempInit

func (s *RouterTemp) RouterTempInit(create *FileCreate)

type ServiceFile

type ServiceFile struct {
	ServicePathDetail    string //详情页面
	ServicePath          string //实体页面
	ServicePathEdit      string //编辑接口
	ServicePathStatusDel string //修改状态或者删除
	ServicePathList      string //列表数据
}

func (*ServiceFile) Service

func (s *ServiceFile) Service(create *FileCreate) error

func (*ServiceFile) ServiceDetail

func (s *ServiceFile) ServiceDetail(create *FileCreate) error

func (*ServiceFile) ServiceEdit

func (s *ServiceFile) ServiceEdit(create *FileCreate) error

func (*ServiceFile) ServiceFileInit

func (s *ServiceFile) ServiceFileInit(create *FileCreate)

func (*ServiceFile) ServiceList

func (s *ServiceFile) ServiceList(create *FileCreate) error

func (*ServiceFile) ServiceStatusDel

func (s *ServiceFile) ServiceStatusDel(create *FileCreate) error

func (*ServiceFile) SetInit

func (s *ServiceFile) SetInit(create *FileCreate)

type ServiceTemp

type ServiceTemp struct {
	ServicePath          string
	ServiceDetailPath    string
	ServiceEditPath      string
	ServiceStatusDelPath string
	ServiceListPath      string
}

func (*ServiceTemp) ServiceTempInit

func (s *ServiceTemp) ServiceTempInit(create *FileCreate)

type TempFile

type TempFile struct {
	BasePath string
	ApiTemp
	ModelTemp
	ServiceTemp
	RequestTemp
	RouterTemp
}

func (*TempFile) TempFileInit

func (t *TempFile) TempFileInit(create *FileCreate)

type WaitGroupWrapper

type WaitGroupWrapper struct {
	sync.WaitGroup
}

func (*WaitGroupWrapper) Wrap

func (w *WaitGroupWrapper) Wrap(f func())

Jump to

Keyboard shortcuts

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