gogit

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: Apache-2.0 Imports: 30 Imported by: 11

Documentation

Index

Constants

View Source
const ClientName = "go-git"

ClientName is the string representation of Client.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*repository.DiscardCloser
	// contains filtered or unexported fields
}

Client implements repository.Client.

func NewClient

func NewClient(path string, authOpts *git.AuthOptions, clientOpts ...ClientOption) (*Client, error)

NewClient returns a new GoGitClient.

func (*Client) Clone

func (g *Client) Clone(ctx context.Context, url string, cloneOpts repository.CloneOptions) (*git.Commit, error)

func (*Client) Commit

func (g *Client) Commit(info git.Commit, commitOpts ...repository.CommitOption) (string, error)

func (*Client) Head

func (g *Client) Head() (string, error)

func (*Client) Init

func (g *Client) Init(ctx context.Context, url, branch string) error

func (*Client) IsClean

func (g *Client) IsClean() (bool, error)

func (*Client) Path

func (g *Client) Path() string

func (*Client) Push

func (g *Client) Push(ctx context.Context) error

func (*Client) SwitchBranch

func (g *Client) SwitchBranch(ctx context.Context, branchName string) error

type ClientOption

type ClientOption func(*Client) error

func WithDiskStorage

func WithDiskStorage() ClientOption

func WithForcePush added in v0.2.0

func WithForcePush() ClientOption

WithForcePush enables the use of force push for all push operations back to the Git repository. By default this is disabled.

func WithInsecureCredentialsOverHTTP added in v0.2.0

func WithInsecureCredentialsOverHTTP() ClientOption

WithInsecureCredentialsOverHTTP enables credentials being used over HTTP. This is not recommended for production environments.

func WithMemoryStorage

func WithMemoryStorage() ClientOption

func WithStorer

func WithStorer(s storage.Storer) ClientOption

func WithWorkTreeFS

func WithWorkTreeFS(wt billy.Filesystem) ClientOption

type CustomPublicKeys

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

CustomPublicKeys is a wrapper around ssh.PublicKeys to help us customize the ssh config. It implements ssh.AuthMethod.

func (*CustomPublicKeys) ClientConfig

func (a *CustomPublicKeys) ClientConfig() (*gossh.ClientConfig, error)

func (*CustomPublicKeys) Name

func (a *CustomPublicKeys) Name() string

func (*CustomPublicKeys) String

func (a *CustomPublicKeys) String() string

Directories

Path Synopsis
Package securejoin is an implementation of the hopefully-soon-to-be-included SecureJoin helper that is meant to be part of the "path/filepath" package.
Package securejoin is an implementation of the hopefully-soon-to-be-included SecureJoin helper that is meant to be part of the "path/filepath" package.

Jump to

Keyboard shortcuts

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