git

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: MIT Imports: 10 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 AddOption

type AddOption func(o *gogit.AddOptions)

func AddAll

func AddAll() AddOption

func AddMask

func AddMask(m string) AddOption

func AddPath

func AddPath(p string) AddOption

type Auth

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

type CheckoutOption

type CheckoutOption func(o *gogit.CheckoutOptions)

func ForceCheckout

func ForceCheckout() CheckoutOption

func KeepCheckout

func KeepCheckout() CheckoutOption

func WithCreate

func WithCreate() CheckoutOption

type CloneOption added in v1.0.4

type CloneOption func(o *gogit.CloneOptions)

func WithAuth added in v1.0.4

func WithAuth(auth Auth) CloneOption

func WithBranch added in v1.0.4

func WithBranch(branch string) CloneOption

func WithTag added in v1.0.4

func WithTag(tag string) CloneOption

func WithURI added in v1.0.4

func WithURI(uri string) CloneOption

type CommitOption

type CommitOption func(o *gogit.CommitOptions)

func CommitAll

func CommitAll() CommitOption

func WithAuthor

func WithAuthor(user, email string, t time.Time) CommitOption

func WithCommiter

func WithCommiter(user, email string, t time.Time) CommitOption

type OptionFunc added in v1.0.2

type OptionFunc interface {
	CloneOption |
		CheckoutOption |
		AddOption |
		CommitOption |
		PushOption
}

type OptionType added in v1.0.2

type PushOption

type PushOption func(o *gogit.PushOptions)

func ForcePush

func ForcePush() PushOption

func WithAtomic

func WithAtomic() PushOption

func WithOpts

func WithOpts(opts map[string]string) PushOption

func WithRemote

func WithRemote(r string) PushOption

func WithRemoteURL

func WithRemoteURL(rurl string) PushOption

func WithTags

func WithTags() PushOption

type Ref

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

type Repo

type Repo interface {
	Pull() (Repo, error)
	Head() (Ref, error)
	Checkout(target string, options ...CheckoutOption) error
	Add(opts ...AddOption) error
	Commit(message string, opts ...CommitOption) (string, error)
	Push(options ...PushOption) error
	Remotes() map[string][]string
}

func Clone

func Clone(path string, options ...CloneOption) (Repo, error)

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

func Open

func Open(path string, opts ...CloneOption) (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