git

package module
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: MIT Imports: 12 Imported by: 0

README

git

Documentation

Index

Constants

View Source
const (
	ErrWrongRepoPath    = errors.Const("wrong repo path")
	ErrRepoPathNotEmpty = errors.Const("repo path directory is not empty")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth interface {
	BasicMethod() *http.BasicAuth
	TokenMethod() *http.TokenAuth
}

type Option

type Option[T OptionType] func(*T)

func AddAll

func AddAll() Option[gogit.AddOptions]

func AddMask

func AddMask(m string) Option[gogit.AddOptions]

func AddPath

func AddPath(p string) Option[gogit.AddOptions]

func CheckoutCreate added in v1.0.6

func CheckoutCreate() Option[gogit.CheckoutOptions]

func CloneAuth added in v1.0.6

func CloneAuth(auth Auth) Option[gogit.CloneOptions]

func CloneBranch added in v1.0.6

func CloneBranch(branch string) Option[gogit.CloneOptions]

func CloneTag added in v1.0.6

func CloneTag(tag string) Option[gogit.CloneOptions]

func CloneURI added in v1.0.6

func CloneURI(uri string) Option[gogit.CloneOptions]

func CommitAll

func CommitAll() Option[gogit.CommitOptions]

func CommitAuthor added in v1.0.6

func CommitAuthor(user, email string, t time.Time) Option[gogit.CommitOptions]

func Commiter added in v1.0.6

func Commiter(user, email string, t time.Time) Option[gogit.CommitOptions]

func ForceCheckout

func ForceCheckout() Option[gogit.CheckoutOptions]

func ForcePush

func ForcePush() Option[gogit.PushOptions]

func KeepCheckout

func KeepCheckout() Option[gogit.CheckoutOptions]

func PullBranch added in v1.0.6

func PullBranch(branch string) Option[gogit.PullOptions]

func PullRemote added in v1.0.6

func PullRemote(name string) Option[gogit.PullOptions]

func PullRemoteURL added in v1.0.6

func PullRemoteURL(uri string) Option[gogit.PullOptions]

func PullTag added in v1.0.6

func PullTag(tag string) Option[gogit.PullOptions]

func PushAtomic added in v1.0.6

func PushAtomic() Option[gogit.PushOptions]

func PushOpts added in v1.0.6

func PushOpts(opts map[string]string) Option[gogit.PushOptions]

func PushRemote added in v1.0.6

func PushRemote(r string) Option[gogit.PushOptions]

func PushRemoteURL added in v1.0.6

func PushRemoteURL(uri string) Option[gogit.PushOptions]

func PushTags added in v1.0.6

func PushTags() Option[gogit.PushOptions]

type OptionType added in v1.0.2

type Ref

type Ref interface {
	Name() string
	Hash() string
}

type Repo

type Repo interface {
	Pull(options ...Option[gogit.PullOptions]) error
	Head() (Ref, error)
	Checkout(target string, options ...Option[gogit.CheckoutOptions]) error
	Add(opts ...Option[gogit.AddOptions]) error
	Commit(message string, opts ...Option[gogit.CommitOptions]) (string, error)
	Push(options ...Option[gogit.PushOptions]) error
	Remotes() map[string][]string
}

func Clone

func Clone(path string, options ...Option[gogit.CloneOptions]) (Repo, error)

Clone - клонирует репозиторий с укзанным uri по указаанному пути и возвращает интерфейс доступа к нему

func Open

func Open(path string, opts ...Option[gogit.CloneOptions]) (Repo, error)

Open - открывает существующий репозиторий

type TokenName

type TokenName string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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