gitops

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecGitCommand

type ExecGitCommand struct{}

func (*ExecGitCommand) ReadFile

func (g *ExecGitCommand) ReadFile(path string) ([]byte, error)

func (*ExecGitCommand) Run

func (g *ExecGitCommand) Run(ctx context.Context, cmd string, args []string, dir string) ([]byte, error)

type GitClient

type GitClient struct {
	Command GitCommand
}

func NewGitClient

func NewGitClient(command *GitCommand) *GitClient

func (*GitClient) Clone

func (g *GitClient) Clone(ctx context.Context, clonePath string, url string, token string, ref string) error

func (*GitClient) CommitSHA

func (g *GitClient) CommitSHA(clonePath string) (string, error)

func (*GitClient) GetRemoteOriginURL

func (g *GitClient) GetRemoteOriginURL(ctx context.Context, repoPath string) (string, error)

func (*GitClient) GetRepoHeadBranchName

func (g *GitClient) GetRepoHeadBranchName(ctx context.Context, repoPath string) (string, error)

func (*GitClient) LastCommitDate

func (g *GitClient) LastCommitDate(ctx context.Context, clonePath string) (time.Time, error)

type GitCloneError

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

func (*GitCloneError) Error

func (e *GitCloneError) Error() string

type GitCommand

type GitCommand interface {
	Run(ctx context.Context, cmd string, args []string, dir string) ([]byte, error)
	ReadFile(path string) ([]byte, error)
}

type LocalGitClient added in v0.9.12

type LocalGitClient struct {
	GitClient *GitClient
}

func NewLocalGitClient added in v0.9.12

func NewLocalGitClient(command *GitCommand) *LocalGitClient

func (*LocalGitClient) Clone added in v0.9.12

func (g *LocalGitClient) Clone(ctx context.Context, clonePath string, url string, token string, ref string) error

func (*LocalGitClient) CommitSHA added in v0.9.12

func (g *LocalGitClient) CommitSHA(clonePath string) (string, error)

func (*LocalGitClient) GetRemoteOriginURL added in v0.9.12

func (g *LocalGitClient) GetRemoteOriginURL(ctx context.Context, repoPath string) (string, error)

func (*LocalGitClient) GetRepoHeadBranchName added in v0.9.12

func (g *LocalGitClient) GetRepoHeadBranchName(ctx context.Context, repoPath string) (string, error)

func (*LocalGitClient) LastCommitDate added in v0.9.12

func (g *LocalGitClient) LastCommitDate(ctx context.Context, clonePath string) (time.Time, error)

Jump to

Keyboard shortcuts

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