git

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client manages client side of git

func NewClient

func NewClient(dirName, url string, opts ...Option) (*Client, error)

NewClient creates a new git client

func (*Client) Clean

func (c *Client) Clean() error

Clean deletes the git directory

func (*Client) Clone

func (c *Client) Clone() error

Clone clones a repository into defined path

func (*Client) GetBranchName

func (c *Client) GetBranchName() string

func (*Client) GetDirectoryPath

func (c *Client) GetDirectoryPath() string

GetDirectoryPath returns a directory path which project was cloned

func (*Client) GetGitParams

func (c *Client) GetGitParams() (url, ref string, cloneDepth int)

GetGitParams returns params of git client

func (*Client) GetHeadRevision

func (c *Client) GetHeadRevision() (string, error)

GetHeadRevision returns a revision of HEAD commit

func (*Client) GetName

func (c *Client) GetName() string

func (*Client) GetPath

func (c *Client) GetPath() string

func (*Client) Pull

func (c *Client) Pull() error

Pull pulls changes from git repository

type Option

type Option func(client *Client)

func WithAuth

func WithAuth(username, passwordOrToken string) Option

func WithCloneDepth

func WithCloneDepth(depth int) Option

func WithCloneTimeout

func WithCloneTimeout(timeout time.Duration) Option

func WithPullTimeout

func WithPullTimeout(timeout time.Duration) Option

func WithPushTimeout

func WithPushTimeout(timeout time.Duration) Option

func WithReferenceName

func WithReferenceName(refName string) Option

Jump to

Keyboard shortcuts

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