vcs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExampleUsage

func ExampleUsage()

Example usage function

Types

type GitConfig

type GitConfig struct {
	UserName  string
	UserEmail string
	RepoPath  string
}

type GitRepository

type GitRepository interface {
	CreateRepo(ctx context.Context, path string) error
	Commit(ctx context.Context, message string) (string, error)
	Diff(ctx context.Context, fileName string) (string, error)
	AddRemote(ctx context.Context, name, url string) error
	Push(ctx context.Context, remoteName, branch string) error
	Close() error
}

type Repo

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

func NewRepo

func NewRepo(path string) *Repo

func (*Repo) AddRemote

func (g *Repo) AddRemote(ctx context.Context, name, url string) error

AddRemote adds a remote repository

func (*Repo) Close

func (g *Repo) Close() error

Close closes the repository and frees resources

func (*Repo) Commit

func (g *Repo) Commit(ctx context.Context, message string) (string, error)

func (*Repo) Create

func (g *Repo) Create(ctx context.Context, path string) error

func (*Repo) Diff

func (g *Repo) Diff(ctx context.Context, fileName string) (string, error)

func (*Repo) Open

func (g *Repo) Open(path string) error

func (*Repo) Push

func (g *Repo) Push(ctx context.Context, remoteName, branch string) error

Push pushes commits to remote repository

Jump to

Keyboard shortcuts

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