git

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2018 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command added in v0.2.0

func Command(cmdWithoutGit string) (*exec.Cmd, error)

func DefaultHost added in v0.2.0

func DefaultHost() string

func DefaultUser added in v0.2.0

func DefaultUser() string

func DefaultWorkspace added in v0.2.0

func DefaultWorkspace() string

func RunCommand added in v0.2.0

func RunCommand(cmdWithoutGit string) error

RunCommand execute the command and redirect input/output to standard input/output

Types

type App added in v0.2.0

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

func NewApp added in v0.2.0

func NewApp(r Ayi.Registry) (*App, error)

func (*App) CobraCommand added in v0.2.0

func (a *App) CobraCommand() *cobra.Command

func (*App) GetLogger added in v0.2.0

func (a *App) GetLogger() *dlog.Logger

func (*App) LoggerIdentity added in v0.2.0

func (a *App) LoggerIdentity(justCallMe func() dlog.Identity) dlog.Identity

func (*App) SetLogger added in v0.2.0

func (a *App) SetLogger(logger *dlog.Logger)

type CloneResult added in v0.2.0

type CloneResult struct {
	Path     string
	Duration time.Duration
}

type Host

type Host struct {
}

type Protocol added in v0.2.0

type Protocol string
const (
	Http  Protocol = "http"
	Https Protocol = "https"
	Ssh   Protocol = "ssh"
)

type Repo

type Repo struct {
	// Protocol is http, https, ssh
	Protocol Protocol
	// Host is the git host provider domain name, like github.com
	Host string
	// Port is used for remote that does not use default ssh port
	Port int
	// Owner is user name or organization name
	Owner string
	// Repository is name of the repo
	Repository string
}

Repo represents the address came after git clone <repo>

func UrlToRepo added in v0.2.0

func UrlToRepo(u string) (*Repo, error)

UrlToRepo detect git repository from url - http clone url: https://github.com/dyweb/Ayi.git - http common url: https://github.com/dyweb/Ayi/blob/master/README.md - ssh clone url: git@github.com:dyweb/Ayi.git ssh://git@git.dongyue.io:6773/at15/tongqu4.git - project name: go.ice -> github.com/at15/go.ice - owner/project: dyweb/Ayi -> github.com/dyweb/Ayi

func (*Repo) HttpUrl added in v0.2.0

func (r *Repo) HttpUrl() string

HttpUrl is used for clone using http i.e. https://github.com/at15/go.ice.git

func (*Repo) SshUrl added in v0.2.0

func (r *Repo) SshUrl() string

SshUrl is used for clone using ssh i.e. git@github.com:at15/go.ice.git

Jump to

Keyboard shortcuts

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