Documentation
¶
Overview ¶
package executor provides a git-describe executor for gh-git-describe.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor interface {
// GetLogger returns the logger instance.
GetLogger() *slog.Logger
// RunRepoClone clones the specified GitHub repository.
RunRepoClone(params *RepoCloneParams) (string, error)
// RunRepoCloneContext clones the specified GitHub repository with the specified context.
RunRepoCloneContext(ctx context.Context, params *RepoCloneParams) (string, error)
// RunGit runs the specified git command.
RunGit(params *RepoCloneParams, command string, args ...string) (string, error)
// RunGitContext runs the specified git command with the specified context.
RunGitContext(ctx context.Context, params *RepoCloneParams, command string, args ...string) (string, error)
// RunGitDescribe runs the 'git describe' command for the specified GitHub repository.
RunGitDescribe(params *RepoCloneParams, args ...string) (string, error)
// RunGitDescribeContext runs the 'git describe' command for the specified GitHub repository with the specified context.
RunGitDescribeContext(ctx context.Context, params *RepoCloneParams, args ...string) (string, error)
// RunGitRevParse runs the 'git rev-parse' command for the specified GitHub repository.
RunGitRevParse(params *RepoCloneParams, args ...string) (string, error)
// RunGitRevParseContext runs the 'git rev-parse' command for the specified GitHub repository with the specified context.
RunGitRevParseContext(ctx context.Context, params *RepoCloneParams, args ...string) (string, error)
}
Executor is an interface for the command executors.
type Params ¶
type Params struct {
// GitExecutor is an instance of gitexec.GitExecutor
GitExecutor gitexec.GitExecutor
// Logger is the slog.Logger instance.
Logger *slog.Logger
// CacheDirPath is the directory path to store the cache.
CacheDirPath string
// CacheDirPerm is the permission for the cache directory.
// Default is 0750.
CacheDirPerm os.FileMode
// CacheTTL is the cache retention duration for the cloned repository.
CacheTTL time.Duration
}
Params represents the parameters for the New function.
type RepoCloneParams ¶
type RepoCloneParams struct {
// RepoID is the repository ID (OWNER/NAME) of the repository to clone.
// If not specified, the current repository is used.
RepoID string
// CacheTTL is the cache TTL duration.
CacheTTL time.Duration
}
RepoCloneParams represents the parameters for the RunRepoClone function.
Click to show internal directories.
Click to hide internal directories.