workspace

package
v0.0.0-...-aefb0d4 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 10 Imported by: 0

README

workspace

go-git を使った git 操作を行い、レポジトリの clone, 変更, push などを行うサンプル。

workspace という概念にして interface 化することで、安全に repository への操作を行うことができる。

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Workspace

type Workspace interface {
	CreateBranch(branch string) error
	UpdateFile(fileRelPath string, content []byte) error
	CommitFiles(branch, message string, fileRelPaths []string) error
	GitPush(branch string) error
	Clear() error
}

Workspace は git のレポジトリを clone したディレクトリ。clone したファイルの作業場となる Workspace への操作はすべて interface を通じて行わなければならない

func NewWorkspace

func NewWorkspace(ctx context.Context, repoURL string, auth transport.AuthMethod) (Workspace, error)

Jump to

Keyboard shortcuts

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