base

package
v0.0.0-...-d1e2d76 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoGet

func GoGet(path ...string) error

GoGet go get path.

func GosHomeWithDir

func GosHomeWithDir(dir string) 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 ParseCommitsInfo

func ParseCommitsInfo(info []CommitInfo) string

func ParseGithubUrl

func ParseGithubUrl(url string) (owner string, repo string)

func ParseReleaseInfo

func ParseReleaseInfo(info ReleaseInfo) string

func Tree

func Tree(path string, dir string)

Types

type CommitInfo

type CommitInfo struct {
	Commit struct {
		Message string `json:"message"`
	} `json:"commit"`
}

type ErrorInfo

type ErrorInfo struct {
	Message string
}

type GithubApi

type GithubApi struct {
	Owner string
	Repo  string
	Token string
}

func (*GithubApi) GetCommitsInfo

func (g *GithubApi) GetCommitsInfo() []CommitInfo

GetCommitsInfo for getting goatkit commits info.

func (*GithubApi) GetReleaseInfo

func (g *GithubApi) GetReleaseInfo(version string) ReleaseInfo

GetReleaseInfo for getting goatkit release info.

type ReleaseInfo

type ReleaseInfo struct {
	Author struct {
		Login string `json:"login"`
	} `json:"author"`
	PublishedAt string `json:"published_at"`
	Body        string `json:"body"`
	HtmlUrl     string `json:"html_url"`
}

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) 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