git

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 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 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 CommitAll

func CommitAll() 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 WithAtomic

func WithAtomic() Option[gogit.PushOptions]

func WithAuth added in v1.0.4

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

func WithAuthor

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

func WithBranch added in v1.0.4

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

func WithCommiter

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

func WithCreate

func WithCreate() Option[gogit.CheckoutOptions]

func WithOpts

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

func WithRemote

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

func WithRemoteURL

func WithRemoteURL(rurl string) Option[gogit.PushOptions]

func WithTag added in v1.0.4

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

func WithTags

func WithTags() Option[gogit.PushOptions]

func WithURI added in v1.0.4

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

type OptionType added in v1.0.2

type Ref

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

type Repo

type Repo interface {
	Pull() (Repo, 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