Documentation
¶
Overview ¶
Package github provides a client for interacting with GitHub repositories as vaults.
Index ¶
- func ParseRepoURL(repoURL string) (string, string, error)
- func ReadFileFromStdin() ([]byte, error)
- type Client
- func (c *Client) CheckConnectivity(ctx context.Context) error
- func (c *Client) DeleteFile(ctx context.Context, path, sha, message string) error
- func (c *Client) DownloadFile(ctx context.Context, path string) ([]byte, error)
- func (c *Client) GetFileSHA(ctx context.Context, path string) (string, error)
- func (c *Client) GetRepository(ctx context.Context) (*github.Repository, error)
- func (c *Client) ListFiles(ctx context.Context) ([]vault.FileInfo, error)
- func (c *Client) Owner() string
- func (c *Client) Repo() string
- func (c *Client) RepoURL() string
- func (c *Client) UploadFile(ctx context.Context, path string, content []byte, message string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseRepoURL ¶
ParseRepoURL parses a GitHub repository URL and returns owner and repo name. Supports HTTPS URLs: https://github.com/owner/repo. Supports SSH URLs: git@github.com:owner/repo.git. Supports short URLs: owner/repo.
func ReadFileFromStdin ¶
ReadFileFromStdin reads content from standard input.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the GitHub client and provides vault operations.
func NewClientFromURL ¶
NewClientFromURL creates a new GitHub client from a repository URL and token. Supports HTTPS URLs like: https://github.com/owner/repo. Supports SSH URLs like: git@github.com:owner/repo.git.
func (*Client) CheckConnectivity ¶
CheckConnectivity verifies that the token has access to the repository.
func (*Client) DeleteFile ¶
DeleteFile deletes a file from the vault.
func (*Client) DownloadFile ¶
DownloadFile downloads a file from the vault.
func (*Client) GetFileSHA ¶
GetFileSHA returns the SHA of a file for update operations.
func (*Client) GetRepository ¶
GetRepository returns the repository info.