Documentation
¶
Index ¶
- func SnapshotRepo(repo *git.Repository, snap *RepoSnapshot) error
- type CommitSnapshot
- type GitRepoResource
- func (r *GitRepoResource) GetCommit(ctx context.Context, req *s4wave_git.GetCommitRequest) (*s4wave_git.GetCommitResponse, error)
- func (r *GitRepoResource) GetDiffStat(ctx context.Context, req *s4wave_git.GetDiffStatRequest) (*s4wave_git.GetDiffStatResponse, error)
- func (r *GitRepoResource) GetMux() srpc.Mux
- func (r *GitRepoResource) GetRepoFilesystemResource(ctx context.Context, req *s4wave_git.GetRepoFilesystemResourceRequest) (*s4wave_git.GetRepoFilesystemResourceResponse, error)
- func (r *GitRepoResource) GetRepoInfo(ctx context.Context, req *s4wave_git.GetRepoInfoRequest) (*s4wave_git.GetRepoInfoResponse, error)
- func (r *GitRepoResource) GetTreeResource(ctx context.Context, req *s4wave_git.GetTreeResourceRequest) (*s4wave_git.GetTreeResourceResponse, error)
- func (r *GitRepoResource) ListRefs(ctx context.Context, req *s4wave_git.ListRefsRequest) (*s4wave_git.ListRefsResponse, error)
- func (r *GitRepoResource) Log(ctx context.Context, req *s4wave_git.LogRequest) (*s4wave_git.LogResponse, error)
- func (r *GitRepoResource) ResolveRef(ctx context.Context, req *s4wave_git.ResolveRefRequest) (*s4wave_git.ResolveRefResponse, error)
- type GitWorktreeResource
- func (r *GitWorktreeResource) GetMux() srpc.Mux
- func (r *GitWorktreeResource) GetRepoResource(ctx context.Context, req *s4wave_git.GetRepoResourceRequest) (*s4wave_git.GetRepoResourceResponse, error)
- func (r *GitWorktreeResource) GetWorkdirResource(ctx context.Context, req *s4wave_git.GetWorkdirResourceRequest) (*s4wave_git.GetWorkdirResourceResponse, error)
- func (r *GitWorktreeResource) GetWorktreeInfo(ctx context.Context, req *s4wave_git.GetWorktreeInfoRequest) (*s4wave_git.GetWorktreeInfoResponse, error)
- func (r *GitWorktreeResource) StageFiles(ctx context.Context, req *s4wave_git.StageFilesRequest) (*s4wave_git.StageFilesResponse, error)
- func (r *GitWorktreeResource) UnstageFiles(ctx context.Context, req *s4wave_git.UnstageFilesRequest) (*s4wave_git.UnstageFilesResponse, error)
- func (r *GitWorktreeResource) WatchStatus(req *s4wave_git.WatchStatusRequest, ...) error
- type RefSnapshot
- type RepoSnapshot
- type WorktreeSnapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SnapshotRepo ¶
func SnapshotRepo(repo *git.Repository, snap *RepoSnapshot) error
SnapshotRepo reads the initial state of the repo into a RepoSnapshot.
Types ¶
type CommitSnapshot ¶
type CommitSnapshot struct {
// Hash is the commit hash.
Hash string
// Message is the commit message.
Message string
// AuthorName is the author name.
AuthorName string
// AuthorEmail is the author email.
AuthorEmail string
// AuthorTimestamp is the author time as Unix seconds.
AuthorTimestamp int64
}
CommitSnapshot holds snapshot data for a single commit.
type GitRepoResource ¶
type GitRepoResource struct {
// contains filtered or unexported fields
}
GitRepoResource implements GitRepoResourceService for a git/repo object. Each RPC call re-opens the repo via AccessWorldObjectRepo for read-only access.
func NewGitRepoResource ¶
func NewGitRepoResource(ws world.WorldState, objKey string, snap *RepoSnapshot) *GitRepoResource
NewGitRepoResource creates a new GitRepoResource.
func (*GitRepoResource) GetCommit ¶
func (r *GitRepoResource) GetCommit(ctx context.Context, req *s4wave_git.GetCommitRequest) (*s4wave_git.GetCommitResponse, error)
GetCommit returns full metadata for a single commit.
func (*GitRepoResource) GetDiffStat ¶
func (r *GitRepoResource) GetDiffStat(ctx context.Context, req *s4wave_git.GetDiffStatRequest) (*s4wave_git.GetDiffStatResponse, error)
GetDiffStat returns diff stats between two refs.
func (*GitRepoResource) GetMux ¶
func (r *GitRepoResource) GetMux() srpc.Mux
GetMux returns the srpc mux for this resource.
func (*GitRepoResource) GetRepoFilesystemResource ¶
func (r *GitRepoResource) GetRepoFilesystemResource(ctx context.Context, req *s4wave_git.GetRepoFilesystemResourceRequest) (*s4wave_git.GetRepoFilesystemResourceResponse, error)
GetRepoFilesystemResource creates a FSHandle sub-resource for the materialized repo filesystem.
func (*GitRepoResource) GetRepoInfo ¶
func (r *GitRepoResource) GetRepoInfo(ctx context.Context, req *s4wave_git.GetRepoInfoRequest) (*s4wave_git.GetRepoInfoResponse, error)
GetRepoInfo returns repository overview information.
func (*GitRepoResource) GetTreeResource ¶
func (r *GitRepoResource) GetTreeResource(ctx context.Context, req *s4wave_git.GetTreeResourceRequest) (*s4wave_git.GetTreeResourceResponse, error)
GetTreeResource creates a FSHandle sub-resource for a ref's tree.
Uses ConstructChildResource to get a sub-context that outlives the RPC call. The persistent block cursors, git store, and FSCursor all use this sub-context and are released when the sub-resource is torn down.
func (*GitRepoResource) ListRefs ¶
func (r *GitRepoResource) ListRefs(ctx context.Context, req *s4wave_git.ListRefsRequest) (*s4wave_git.ListRefsResponse, error)
ListRefs lists all branches and tags in the repository.
func (*GitRepoResource) Log ¶
func (r *GitRepoResource) Log(ctx context.Context, req *s4wave_git.LogRequest) (*s4wave_git.LogResponse, error)
Log returns a paginated list of commits starting from a ref.
func (*GitRepoResource) ResolveRef ¶
func (r *GitRepoResource) ResolveRef(ctx context.Context, req *s4wave_git.ResolveRefRequest) (*s4wave_git.ResolveRefResponse, error)
ResolveRef resolves a ref name to a commit hash and tree hash.
type GitWorktreeResource ¶
type GitWorktreeResource struct {
// contains filtered or unexported fields
}
GitWorktreeResource implements GitWorktreeResourceService for a git/worktree object.
func NewGitWorktreeResource ¶
func NewGitWorktreeResource(ws world.WorldState, engine world.Engine, objKey string, snap *WorktreeSnapshot) *GitWorktreeResource
NewGitWorktreeResource creates a new GitWorktreeResource.
func (*GitWorktreeResource) GetMux ¶
func (r *GitWorktreeResource) GetMux() srpc.Mux
GetMux returns the srpc mux for this resource.
func (*GitWorktreeResource) GetRepoResource ¶
func (r *GitWorktreeResource) GetRepoResource(ctx context.Context, req *s4wave_git.GetRepoResourceRequest) (*s4wave_git.GetRepoResourceResponse, error)
GetRepoResource creates a GitRepoResource sub-resource for the linked git/repo object.
func (*GitWorktreeResource) GetWorkdirResource ¶
func (r *GitWorktreeResource) GetWorkdirResource(ctx context.Context, req *s4wave_git.GetWorkdirResourceRequest) (*s4wave_git.GetWorkdirResourceResponse, error)
GetWorkdirResource creates a FSHandle sub-resource for the mutable workdir.
func (*GitWorktreeResource) GetWorktreeInfo ¶
func (r *GitWorktreeResource) GetWorktreeInfo(ctx context.Context, req *s4wave_git.GetWorktreeInfoRequest) (*s4wave_git.GetWorktreeInfoResponse, error)
GetWorktreeInfo returns worktree metadata.
func (*GitWorktreeResource) StageFiles ¶
func (r *GitWorktreeResource) StageFiles(ctx context.Context, req *s4wave_git.StageFilesRequest) (*s4wave_git.StageFilesResponse, error)
StageFiles stages files in the git index.
func (*GitWorktreeResource) UnstageFiles ¶
func (r *GitWorktreeResource) UnstageFiles(ctx context.Context, req *s4wave_git.UnstageFilesRequest) (*s4wave_git.UnstageFilesResponse, error)
UnstageFiles unstages files from the git index.
func (*GitWorktreeResource) WatchStatus ¶
func (r *GitWorktreeResource) WatchStatus( req *s4wave_git.WatchStatusRequest, strm s4wave_git.SRPCGitWorktreeResourceService_WatchStatusStream, ) error
WatchStatus streams git index state as the worktree changes.
type RefSnapshot ¶
type RefSnapshot struct {
// Name is the short reference name.
Name string
// CommitHash is the commit hash.
CommitHash string
// IsHead is true if this ref matches HEAD.
IsHead bool
}
RefSnapshot holds snapshot data for a single reference.
type RepoSnapshot ¶
type RepoSnapshot struct {
// HeadRef is the short name of HEAD's target reference.
HeadRef string
// HeadCommitHash is the commit hash HEAD resolves to.
HeadCommitHash string
// ReadmePath is the path to the README file in the root tree.
ReadmePath string
// LastCommit contains info about the HEAD commit.
LastCommit *CommitSnapshot
// IsEmpty is true if the repo has no commits.
IsEmpty bool
// Branches is the list of branch refs.
Branches []RefSnapshot
// Tags is the list of tag refs.
Tags []RefSnapshot
}
RepoSnapshot holds a snapshot of repo state collected during factory init.
type WorktreeSnapshot ¶
type WorktreeSnapshot struct {
// RepoObjectKey is the object key of the linked git/repo.
RepoObjectKey string
// WorkdirObjectKey is the object key of the linked workdir.
WorkdirObjectKey string
// WorkdirRef is the unixfs reference to the workdir.
WorkdirRef *unixfs_world.UnixfsRef
// CheckedOutRef is the short name of the checked-out ref.
CheckedOutRef string
// HeadCommitHash is the commit hash of the checked-out ref.
HeadCommitHash string
// HasWorkdir is true if a workdir is linked.
HasWorkdir bool
}
WorktreeSnapshot holds a snapshot of worktree state collected during factory init.