git

package
v0.0.0-...-916d79e Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGitHubClient

func CreateGitHubClient(token string) *scm.Client

CreateGitHubClient creates and returns a go-scm GitHub client, using the provided oauth2 token.

Types

type Cache

type Cache interface {
	ReadFileFromBranch(ctx context.Context, repoURL, filePath, branch string) ([]byte, error)
	CreateAndCheckoutBranch(ctx context.Context, repoURL, fromBranch, newBranch string) error
	WriteFileToBranchAndStage(ctx context.Context, repoURL, branch, filePath string, data []byte) error
	CommitAndPushBranch(ctx context.Context, repoURL, branch, message, token string) error
}

type LocalCache

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

func NewLocalCache

func NewLocalCache(cacheDir, name, email string) (*LocalCache, error)

NewLocalCache creates a new LocalCache and ensures that the provided cacheDir exists.

func (*LocalCache) CommitAndPushBranch

func (l *LocalCache) CommitAndPushBranch(ctx context.Context, repoURL, branch, message, token string) error

func (*LocalCache) CreateAndCheckoutBranch

func (l *LocalCache) CreateAndCheckoutBranch(ctx context.Context, repoURL, fromBranch, newBranch string) error

func (*LocalCache) ReadFileFromBranch

func (l *LocalCache) ReadFileFromBranch(ctx context.Context, repoURL, filePath, branch string) ([]byte, error)

func (*LocalCache) WriteFileToBranchAndStage

func (l *LocalCache) WriteFileToBranchAndStage(ctx context.Context, repoURL, branch, filePath string, data []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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