base

package
v0.0.0-...-d853fe5 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: Apache-2.0 Imports: 13 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

CopyDir 复制文件夹

@param src
@param dst
@param replaces
@param ignores
@return error

func GoInstall

func GoInstall(path ...string) error

GoInstall go get path.

func ModName

func ModName() string

ModName 获取当前项目中的go mod name 简单实现,当前文件夹找不到go.mod,则在父目录中找

@return string

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 Tree

func Tree(path string, dir string)

Tree 遍历文件夹

@param path
@param dir

Types

type Repo

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

Repo is git repository manager.

func NewRepo

func NewRepo(url string, branch 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) CopyFilesTo

func (r *Repo) CopyFilesTo(ctx context.Context, to string, dirs []string) error

CopyFilesTo copies the repository to project path.

func (*Repo) CopyTo

func (r *Repo) CopyTo(ctx context.Context, to string, modPath 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