git

package
Version: v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRepoOpts

type CreateRepoOpts struct {
	Name        string
	Owner       string
	Description string
	Personal    bool
	Privacy     bool
}

type GetRepoOpts

type GetRepoOpts struct {
	Owner      string
	Repository string
}

type Provider

type Provider interface {
	Add(filename string) error
	Remove(filename string) error
	Clone(ctx context.Context) error
	Commit(message string) error
	Push(ctx context.Context) error
	Pull(ctx context.Context, branch string) error
	Init() error
	Branch(name string) error
	GetRepo(ctx context.Context) (repo *Repository, err error)
	CreateRepo(ctx context.Context, opts CreateRepoOpts) (repo *Repository, err error)
	Validate(ctx context.Context) error
	PathExists(ctx context.Context, owner, repo, branch, path string) (bool, error)
}

Provider acts as an interface for specific Git hosting providers -- e.g. GitHub, BitBucket, GitLab, etc. It wraps a low-level git implementation (e.g. gogit) and abstracts auth and provider specific configurations while providing a common interface for local git actions.

type RemoteBranchDoesNotExistError

type RemoteBranchDoesNotExistError struct {
	Repository string
	Branch     string
}

func (*RemoteBranchDoesNotExistError) Error

type Repository

type Repository struct {
	Name         string
	Owner        string
	Organization string
	CloneUrl     string
}

type RepositoryDoesNotExistError

type RepositoryDoesNotExistError struct {
	Err error
	// contains filtered or unexported fields
}

func (*RepositoryDoesNotExistError) Error

type RepositoryIsEmptyError

type RepositoryIsEmptyError struct {
	Repository string
}

func (*RepositoryIsEmptyError) Error

func (e *RepositoryIsEmptyError) Error() string

type RepositoryUpToDateError

type RepositoryUpToDateError struct {
	Repository string
}

func (*RepositoryUpToDateError) Error

func (e *RepositoryUpToDateError) Error() string

type TokenAuth

type TokenAuth struct {
	Username string
	Token    string
}

Source Files

Directories

Path Synopsis
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
providers
github/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL