git

package
v0.0.0-...-fdf59ed Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommitHash

type CommitHash string

CommitHash .

func (*CommitHash) String

func (ch *CommitHash) String() string

String .

type Configuration

type Configuration interface {
	configuration.Provider
}

Configuration .

type DefaultGitClient

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

DefaultGitClient .

func (*DefaultGitClient) BaseBranch

func (d *DefaultGitClient) BaseBranch() string

BaseBranch of git

func (*DefaultGitClient) Commit

func (d *DefaultGitClient) Commit(message string, path []string) (CommitHash, error)

Commit .

func (*DefaultGitClient) Push

func (d *DefaultGitClient) Push(ctx context.Context, branch string) error

Push to origin

func (*DefaultGitClient) Switch

func (d *DefaultGitClient) Switch(branch string, create bool) error

Switch to branch

func (*DefaultGitClient) SwitchBack

func (d *DefaultGitClient) SwitchBack() error

SwitchBack tp origin branch

type Git

type Git interface {
	BaseBranch() string
	Switch(branch string, create bool) error
	SwitchBack() error
	Commit(message string, path []string) (CommitHash, error)
	Push(ctx context.Context, branch string) error
}

Git .

func Clone

func Clone(c Configuration, owner, name string) (Git, filesystem.Filesystem, error)

Clone repository to memory

func OpenCurrentDirectoryRepository

func OpenCurrentDirectoryRepository(c Configuration) (Git, filesystem.Filesystem, error)

OpenCurrentDirectoryRepository opens current directory's repository

type Repository

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

Repository of VCS

func ParseRepository

func ParseRepository(repo string) (*Repository, error)

ParseRepository from owner/name format

func (*Repository) Name

func (r *Repository) Name() string

Name of repository

func (*Repository) Owner

func (r *Repository) Owner() string

Owner of repository

func (*Repository) String

func (r *Repository) String() string

String of original format

Jump to

Keyboard shortcuts

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