Documentation
¶
Index ¶
- type Blob
- type Client
- func (c *Client) AddRepoFolders(ctx context.Context, repoID string, folderIDs []string) ([]Folder, error)
- func (c *Client) AdminCreateNamespace(ctx context.Context, name string) (*Namespace, error)
- func (c *Client) AdminDeleteNamespace(ctx context.Context, id string) error
- func (c *Client) AdminDeleteToken(ctx context.Context, id string) error
- func (c *Client) AdminGetToken(ctx context.Context, id string) (*TokenListItem, error)
- func (c *Client) AdminListNamespaces(ctx context.Context) ([]Namespace, error)
- func (c *Client) AdminListTokens(ctx context.Context) ([]TokenListItem, error)
- func (c *Client) BaseURL() string
- func (c *Client) CreateFolder(ctx context.Context, name string) (*Folder, error)
- func (c *Client) CreateRepo(ctx context.Context, name string, description *string, public bool) (*Repo, error)
- func (c *Client) DeleteFolder(ctx context.Context, id string, force bool) error
- func (c *Client) DeleteRepo(ctx context.Context, id string) error
- func (c *Client) GetBlob(ctx context.Context, repoID, ref, path string) (*Blob, error)
- func (c *Client) GetNamespaceInfo(ctx context.Context) (*Namespace, error)
- func (c *Client) GetReadme(ctx context.Context, repoID, ref string) (*Readme, error)
- func (c *Client) GetTree(ctx context.Context, repoID, ref, path string) ([]TreeEntry, error)
- func (c *Client) GetTreeWithDepth(ctx context.Context, repoID, ref, path string, depth int) ([]TreeEntry, error)
- func (c *Client) ListCommits(ctx context.Context, repoID, ref, cursor string, limit int) ([]Commit, bool, error)
- func (c *Client) ListFolders(ctx context.Context, cursor string, limit int) ([]Folder, bool, error)
- func (c *Client) ListNamespaces(ctx context.Context) ([]NamespaceWithAccess, error)
- func (c *Client) ListRefs(ctx context.Context, repoID string) ([]Ref, error)
- func (c *Client) ListRepoFolders(ctx context.Context, repoID string) ([]Folder, error)
- func (c *Client) ListRepos(ctx context.Context, cursor string, limit int) ([]Repo, bool, error)
- func (c *Client) ListReposWithFolders(ctx context.Context, cursor string, limit int) ([]RepoWithFolders, bool, error)
- func (c *Client) Namespace() string
- func (c *Client) RemoveRepoFolder(ctx context.Context, repoID, folderID string) error
- func (c *Client) Token() string
- func (c *Client) UpdateFolder(ctx context.Context, id string, name *string) (*Folder, error)
- func (c *Client) UpdateRepo(ctx context.Context, id string, name *string, description *string, ...) (*Repo, error)
- func (c *Client) WithNamespace(namespace string) *Client
- type Commit
- type CommitStats
- type Folder
- type GitAuthor
- type Namespace
- type NamespaceGrantResponse
- type NamespaceWithAccess
- type Readme
- type Ref
- type Repo
- type RepoGrantResponse
- type RepoWithFolders
- type TokenListItem
- type TreeEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blob ¶
type Blob struct {
SHA string `json:"sha"`
Size int64 `json:"size"`
Content *string `json:"content,omitempty"`
Encoding string `json:"encoding"`
IsBinary bool `json:"is_binary"`
Truncated bool `json:"truncated"`
}
Blob represents a git blob (file content).
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the HTTP client for the ephemeral API.
func (*Client) AddRepoFolders ¶
func (c *Client) AddRepoFolders(ctx context.Context, repoID string, folderIDs []string) ([]Folder, error)
AddRepoFolders adds folders to a repository.
func (*Client) AdminCreateNamespace ¶
AdminCreateNamespace creates a new namespace (admin only).
func (*Client) AdminDeleteNamespace ¶
AdminDeleteNamespace deletes a namespace (admin only).
func (*Client) AdminDeleteToken ¶
AdminDeleteToken deletes a token (admin only).
func (*Client) AdminGetToken ¶ added in v0.0.3
AdminGetToken retrieves a single token by ID with its grants (admin only).
func (*Client) AdminListNamespaces ¶
AdminListNamespaces lists all namespaces (admin only).
func (*Client) AdminListTokens ¶
func (c *Client) AdminListTokens(ctx context.Context) ([]TokenListItem, error)
AdminListTokens lists all tokens (admin only).
func (*Client) CreateFolder ¶
CreateFolder creates a new folder.
func (*Client) CreateRepo ¶
func (c *Client) CreateRepo(ctx context.Context, name string, description *string, public bool) (*Repo, error)
CreateRepo creates a new repository.
func (*Client) DeleteFolder ¶
DeleteFolder deletes a folder.
func (*Client) DeleteRepo ¶
DeleteRepo deletes a repository.
func (*Client) GetNamespaceInfo ¶
GetNamespaceInfo retrieves information about the current namespace.
func (*Client) GetTreeWithDepth ¶
func (c *Client) GetTreeWithDepth(ctx context.Context, repoID, ref, path string, depth int) ([]TreeEntry, error)
GetTreeWithDepth retrieves the tree with a specified depth for recursive expansion.
func (*Client) ListCommits ¶
func (c *Client) ListCommits(ctx context.Context, repoID, ref, cursor string, limit int) ([]Commit, bool, error)
ListCommits lists commits for a repository.
func (*Client) ListFolders ¶
ListFolders lists folders in the current namespace.
func (*Client) ListNamespaces ¶
func (c *Client) ListNamespaces(ctx context.Context) ([]NamespaceWithAccess, error)
ListNamespaces lists all namespaces the current token has access to.
func (*Client) ListRepoFolders ¶
ListRepoFolders lists folders associated with a repository.
func (*Client) ListReposWithFolders ¶
func (c *Client) ListReposWithFolders(ctx context.Context, cursor string, limit int) ([]RepoWithFolders, bool, error)
ListReposWithFolders lists repositories with their folder associations.
func (*Client) RemoveRepoFolder ¶
RemoveRepoFolder removes a folder from a repository.
func (*Client) UpdateFolder ¶
UpdateFolder updates a folder's metadata.
func (*Client) UpdateRepo ¶
func (c *Client) UpdateRepo(ctx context.Context, id string, name *string, description *string, public *bool) (*Repo, error)
UpdateRepo updates a repository's metadata.
func (*Client) WithNamespace ¶
WithNamespace returns a new client configured to use the specified namespace.
type Commit ¶
type Commit struct {
SHA string `json:"sha"`
Message string `json:"message"`
Author GitAuthor `json:"author"`
Committer GitAuthor `json:"committer"`
ParentSHAs []string `json:"parent_shas"`
TreeSHA string `json:"tree_sha"`
Stats *CommitStats `json:"stats,omitempty"`
}
Commit represents a git commit.
type CommitStats ¶
type CommitStats struct {
FilesChanged int `json:"files_changed"`
Additions int `json:"additions"`
Deletions int `json:"deletions"`
}
CommitStats represents statistics for a commit.
type Folder ¶
type Folder struct {
ID string `json:"id"`
Name string `json:"name"`
Color *string `json:"color,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
Folder represents a folder for organizing repositories.
type GitAuthor ¶
type GitAuthor struct {
Name string `json:"name"`
Email string `json:"email"`
Date time.Time `json:"date"`
}
GitAuthor represents a git author or committer.
type Namespace ¶
type Namespace struct {
ID string `json:"id"`
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
RepoLimit *int `json:"repo_limit,omitempty"`
StorageLimitBytes *int `json:"storage_limit_bytes,omitempty"`
}
Namespace represents a namespace in the system.
type NamespaceGrantResponse ¶
type NamespaceGrantResponse struct {
NamespaceID string `json:"namespace_id"`
Allow []string `json:"allow"`
Deny []string `json:"deny,omitempty"`
IsPrimary bool `json:"is_primary"`
}
NamespaceGrantResponse represents a namespace grant in API responses.
type NamespaceWithAccess ¶
type NamespaceWithAccess struct {
ID string `json:"id"`
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
IsPrimary bool `json:"is_primary"`
}
NamespaceWithAccess represents a namespace with access information.
type Readme ¶
type Readme struct {
Filename string `json:"filename"`
Content string `json:"content"`
Size int64 `json:"size"`
SHA string `json:"sha"`
IsBinary bool `json:"is_binary"`
Truncated bool `json:"truncated"`
}
Readme represents a repository's README file.
type Ref ¶
type Ref struct {
Name string `json:"name"`
Type string `json:"type"`
CommitSHA string `json:"commit_sha"`
IsDefault bool `json:"is_default"`
}
Ref represents a git reference (branch or tag).
type Repo ¶
type Repo struct {
ID string `json:"id"`
NamespaceID string `json:"namespace_id"`
Name string `json:"name"`
Description *string `json:"description,omitempty"`
Public bool `json:"public"`
SizeBytes int `json:"size_bytes"`
LastPushAt *time.Time `json:"last_push_at,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Repo represents a repository.
type RepoGrantResponse ¶
type RepoGrantResponse struct {
RepoID string `json:"repo_id"`
Allow []string `json:"allow"`
Deny []string `json:"deny,omitempty"`
}
RepoGrantResponse represents a repo grant in API responses.
type RepoWithFolders ¶
RepoWithFolders is a repository with its associated folders.
type TokenListItem ¶
type TokenListItem struct {
ID string `json:"id"`
Name *string `json:"name,omitempty"`
IsAdmin bool `json:"is_admin"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
LastUsedAt *time.Time `json:"last_used_at,omitempty"`
NamespaceGrants []NamespaceGrantResponse `json:"namespace_grants,omitempty"`
RepoGrants []RepoGrantResponse `json:"repo_grants,omitempty"`
}
TokenListItem represents a token in list responses (without the secret).
type TreeEntry ¶
type TreeEntry struct {
Name string `json:"name"`
Path string `json:"path"`
Type string `json:"type"`
Mode string `json:"mode"`
SHA string `json:"sha"`
Size *int64 `json:"size,omitempty"`
HasChildren *bool `json:"has_children,omitempty"`
Children []TreeEntry `json:"children,omitempty"`
}
TreeEntry represents an entry in a git tree.