gogit

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: Apache-2.0 Imports: 28 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

func WithDiskStorage

func WithDiskStorage(g *Client) error

func WithMemoryStorage

func WithMemoryStorage(g *Client) error

Types

type Client

type Client struct {
	*git.DiscardRepositoryCloser
	// contains filtered or unexported fields
}

Client implements git.RepositoryClient.

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, checkoutOpts git.CheckoutOptions) (*git.Commit, error)

func (*Client) Commit

func (g *Client) Commit(info git.Commit, signer *openpgp.Entity) (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

func (*Client) WriteFile

func (g *Client) WriteFile(path string, reader io.Reader) error

type ClientOption

type ClientOption func(*Client) error

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

Jump to

Keyboard shortcuts

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