gitops

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 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 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) 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