Documentation
¶
Index ¶
- Constants
- func ValidatePath(repoPath, requestedPath string) error
- type AuthConfig
- type BranchInfo
- type Client
- func (c *Client) BrowseTree(ctx context.Context, repoPath, targetPath string) ([]gitops.FileTreeNode, error)
- func (c *Client) Cleanup(repoPath string) error
- func (c *Client) Clone(ctx context.Context, url, branch string, auth AuthConfig) (string, error)
- func (c *Client) FileExists(ctx context.Context, repoPath, filePath string) bool
- func (c *Client) GetCurrentCommit(ctx context.Context, repoPath string) (string, error)
- func (c *Client) ListBranches(ctx context.Context, url string, auth AuthConfig) ([]BranchInfo, error)
- func (c *Client) ReadFile(ctx context.Context, repoPath, filePath string) (string, error)
- func (c *Client) TestConnection(ctx context.Context, url, branch string, auth AuthConfig) error
- type CommitInfo
Constants ¶
View Source
const ( SSHHostKeyVerificationStrict = "strict" // Require host key in known_hosts SSHHostKeyVerificationAcceptNew = "accept_new" // Auto-add unknown host keys SSHHostKeyVerificationSkip = "skip" // Skip host key verification (insecure) )
SSH host key verification modes
Variables ¶
This section is empty.
Functions ¶
func ValidatePath ¶
ValidatePath ensures the path is safe and doesn't escape the repo
Types ¶
type AuthConfig ¶
type AuthConfig struct {
AuthType string
Username string
Token string
SSHKey string
SSHHostKeyVerification string // strict, accept_new, skip
}
AuthConfig holds authentication configuration
type BranchInfo ¶
BranchInfo holds information about a git branch
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handles git operations
func (*Client) BrowseTree ¶
func (c *Client) BrowseTree(ctx context.Context, repoPath, targetPath string) ([]gitops.FileTreeNode, error)
BrowseTree returns the file tree at the specified path
func (*Client) FileExists ¶
FileExists checks if a file exists in the repository
func (*Client) GetCurrentCommit ¶
GetCurrentCommit returns the HEAD commit hash of a cloned repository
func (*Client) ListBranches ¶
func (c *Client) ListBranches(ctx context.Context, url string, auth AuthConfig) ([]BranchInfo, error)
ListBranches lists all branches in a remote repository
func (*Client) TestConnection ¶
TestConnection tests if the repository can be accessed with the given credentials
Click to show internal directories.
Click to hide internal directories.