base

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(src, dst string, replaces, ignores []string) error

func CopyFile

func CopyFile(src, dst string, replaces []string) error

func DoGenProject

func DoGenProject(p *Project, to string, mgrType string) error

func FirstLower

func FirstLower(s string) string

FirstLower 字符串首字母小写

func FirstUpper

func FirstUpper(s string) string

FirstUpper 字符串首字母大写

func GetArgs

func GetArgs(cmd *cobra.Command, args []string) (app, server, servant, goModuleName string, err error)

func GoInstall

func GoInstall(path ...string) error

GoInstall go get path.

func IsExistTars2go

func IsExistTars2go() bool

func ModulePath

func ModulePath(filename string) (string, error)

ModulePath returns go module path.

func ModuleVersion

func ModuleVersion(path string) (string, error)

ModuleVersion returns module version.

func TarsGoHome

func TarsGoHome() string

func TarsGoHomeWithDir

func TarsGoHomeWithDir(dir string) string

func TarsGoMod

func TarsGoMod() string

TarsGoMod returns TarsGo mod.

func Tree

func Tree(path string, dir string)

Types

type Project

type Project struct {
	App          string
	Server       string
	Servant      string
	GoModuleName string
}

Project is a project template.

func NewProject

func NewProject(app, server, servant, goModuleName string) *Project

func (*Project) Create

func (p *Project) Create(ctx context.Context, dir string, mgrType string) error

Create a project from remote repo.

type Repo

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

Repo is git repository manager.

func NewRepo

func NewRepo(url string, branch string, demoDir string) *Repo

NewRepo new a repository manager.

func (*Repo) Clone

func (r *Repo) Clone(ctx context.Context) error

Clone clones the repository to cache path.

func (*Repo) CopyTo

func (r *Repo) CopyTo(ctx context.Context, p *Project, to string, demoDir string, ignores []string) error

CopyTo copies the repository to project path.

func (*Repo) Path

func (r *Repo) Path() string

Path returns the repository cache path.

func (*Repo) Pull

func (r *Repo) Pull(ctx context.Context) error

Pull fetch the repository from remote url.

Jump to

Keyboard shortcuts

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