Documentation
¶
Index ¶
- Variables
- type BundleInfo
- type BundleOptions
- type CommandError
- type GIT
- func (g *GIT) ApplyBundleToLocal(r io.Reader) error
- func (g *GIT) CreateBundleFromLocal(opt BundleOptions) ([]byte, error)
- func (g GIT) ExistsLocal() (bool, error)
- func (g *GIT) GetBundleInfo(bundleData []byte) (BundleInfo, error)
- func (g *GIT) GetBundleListHeads(bundleData []byte) ([]Head, error)
- func (g *GIT) PushLocalToRemote() error
- func (g *GIT) SyncRepoToLocalTemp() (*git.Worktree, error)
- type GitPullHandler
- type GitPushHandler
- type GogsAdmin
- type Head
- type RemoteRepo
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrAuthFailed = errors.New("authentication failed")
)
Functions ¶
This section is empty.
Types ¶
type BundleInfo ¶
type BundleInfo struct { IsComplete bool ContainsRef string RequiresRef string HashAlgorithm string IsOkay bool }
func ParseBundleVerifyOutput ¶
func ParseBundleVerifyOutput(output string) BundleInfo
func (BundleInfo) Validate ¶
func (b BundleInfo) Validate() error
type BundleOptions ¶
type BundleOptions struct { // since, is the lookback duration for the bundle. Optional. Since time.Duration // after timestamp, optional After time.Time }
func (BundleOptions) HasAny ¶
func (opt BundleOptions) HasAny() bool
type CommandError ¶
type CommandError struct { // Error is the underlying error that occurred Err error // Message is an optional error message Message string // ExitCode represents the exit status or error code of the command ExitCode int // StdErr contains the error output from the command execution StdErr string }
CommandError is a custom error struct for capturing detailed command execution errors
func NewCommandError ¶
func NewCommandError(err error, msg string, status int, stdErr string) *CommandError
NewCommandError creates a new CommandError instance
func (*CommandError) Unwrap ¶
func (e *CommandError) Unwrap() error
Unwrap allows for error unwrapping, supporting Go 1.13+ error handling
type GIT ¶
type GIT struct {
// contains filtered or unexported fields
}
func (*GIT) ApplyBundleToLocal ¶
apply bundle to local repo with "git fetch"
func (*GIT) CreateBundleFromLocal ¶
func (g *GIT) CreateBundleFromLocal(opt BundleOptions) ([]byte, error)
func (GIT) ExistsLocal ¶
func (*GIT) GetBundleInfo ¶
func (g *GIT) GetBundleInfo(bundleData []byte) (BundleInfo, error)
func (*GIT) GetBundleListHeads ¶
func (*GIT) PushLocalToRemote ¶
func (*GIT) SyncRepoToLocalTemp ¶
clones repo from remoteURL if not exists, otherwise pulls the latest changes Returns nil worktree if remote does not exist
type GitPullHandler ¶
type GitPullHandler struct {
// contains filtered or unexported fields
}
func NewGitPullHandler ¶
func NewGitPullHandler(tempDir string) *GitPullHandler
func (*GitPullHandler) ServeHTTP ¶
func (h *GitPullHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GitPushHandler ¶
type GitPushHandler struct {
// contains filtered or unexported fields
}
func NewGitPushHandler ¶
func NewGitPushHandler(tempDir string) *GitPushHandler
func (*GitPushHandler) ServeHTTP ¶
func (h *GitPushHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GogsAdmin ¶
type GogsAdmin struct {
// contains filtered or unexported fields
}
func NewGogsAdmin ¶
func (*GogsAdmin) CreateRandomRepo ¶
func (g *GogsAdmin) CreateRandomRepo(branch string) (RemoteRepo, error)
type Head ¶
type RemoteRepo ¶
Click to show internal directories.
Click to hide internal directories.