git

package module
v1.0.2 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 {
	Username() string
	Token(name TokenName) string
}

type CheckoutOption

type CheckoutOption func(o *gogit.CheckoutOptions)

func ForceCheckout

func ForceCheckout() CheckoutOption

func KeepCheckout

func KeepCheckout() CheckoutOption

func WithCreate

func WithCreate() CheckoutOption

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 {
	CheckoutOption |
		AddOption |
		CommitOption |
		PushOption
}

type OptionType added in v1.0.2

type OptionType interface {
	*gogit.CheckoutOptions |
		*gogit.AddOptions |
		*gogit.CommitOptions |
		*gogit.PushOptions
}

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(uri, path, user, password string) (Repo, error)

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

func Open

func Open(path string) (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