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) ProbeRemote(ctx context.Context, url string, auth AuthConfig) 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
- func (c *Client) WalkDirectory(ctx context.Context, repoPath, composePath string, maxFiles int, ...) (*DirectoryWalkResult, error)
- type CommitInfo
- type DirectoryWalkResult
- type SyncFileInfo
Constants ¶
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) ProbeRemote ¶ added in v1.17.1
ProbeRemote verifies that a remote repository is reachable without cloning it.
func (*Client) TestConnection ¶
TestConnection tests if the repository can be accessed with the given credentials
func (*Client) WalkDirectory ¶
func (c *Client) WalkDirectory(ctx context.Context, repoPath, composePath string, maxFiles int, maxTotalSize, maxBinarySize int64) (*DirectoryWalkResult, error)
WalkDirectory walks the directory containing the compose file and returns all files. It enforces limits on file count, total size, and skips large binary files. The composePath is the path to the compose file within the repo - the directory containing this file will be walked.
type CommitInfo ¶
CommitInfo holds information about a git commit
type DirectoryWalkResult ¶
type DirectoryWalkResult struct {
Files []SyncFileInfo
TotalFiles int
TotalSize int64
SkippedBinaries int
}
DirectoryWalkResult holds the result of walking a directory for sync