gitops

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRepoNotReachable = errors.New("repo or ref not reachable")

Functions

func IsGitRepoUnauthorizedOrNotReachable added in v0.18.0

func IsGitRepoUnauthorizedOrNotReachable(err error) bool

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) BlobMatches added in v0.17.0

func (g *GitClient) BlobMatches(ctx context.Context, clonePath, blobSha string, re *regexp.Regexp) (bool, []byte, error)

blobMatches returns true if the blob (by its SHA) matches the given regex.

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) FetchCone added in v0.17.0

func (g *GitClient) FetchCone(ctx context.Context, clonePath, url, token, ref string, cone 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) GetUniqWorkflowsBranches added in v0.17.0

func (g *GitClient) GetUniqWorkflowsBranches(ctx context.Context, clonePath string) (map[string][]models.BranchInfo, error)

func (*GitClient) LastCommitDate

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

type GitCommand

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

type GitCommandError added in v0.15.2

type GitCommandError struct {
	CommandStr string
	Err        error
}

func (*GitCommandError) Command added in v0.15.2

func (e *GitCommandError) Command() string

func (*GitCommandError) Error added in v0.15.2

func (e *GitCommandError) Error() string

func (*GitCommandError) Unwrap added in v0.15.2

func (e *GitCommandError) Unwrap() error

type GitError added in v0.15.2

type GitError interface {
	error
	Command() string
}

type GitExitError added in v0.15.2

type GitExitError struct {
	CommandStr string
	Stderr     string
	ExitCode   int
	Err        error
}

func (*GitExitError) Command added in v0.15.2

func (e *GitExitError) Command() string

func (*GitExitError) Error added in v0.15.2

func (e *GitExitError) Error() string

func (*GitExitError) Unwrap added in v0.15.2

func (e *GitExitError) Unwrap() error

type GitNotFoundError added in v0.15.2

type GitNotFoundError struct {
	CommandStr string
}

func (*GitNotFoundError) Command added in v0.15.2

func (e *GitNotFoundError) Command() string

func (*GitNotFoundError) Error added in v0.15.2

func (e *GitNotFoundError) Error() string

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) BlobMatches added in v0.17.0

func (g *LocalGitClient) BlobMatches(ctx context.Context, clonePath, blobSha string, re *regexp.Regexp) (bool, []byte, error)

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) FetchCone added in v0.17.0

func (g *LocalGitClient) FetchCone(ctx context.Context, clonePath, url, token, ref, cone 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) GetUniqWorkflowsBranches added in v0.17.0

func (g *LocalGitClient) GetUniqWorkflowsBranches(ctx context.Context, clonePath string) (map[string][]models.BranchInfo, 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