清理复杂的流程

This commit is contained in:
ExplodingDragon
2025-12-22 21:52:08 +08:00
parent 11a42961f3
commit 602d436e0f
14 changed files with 126 additions and 274 deletions

View File

@@ -7,17 +7,14 @@ import (
"time"
)
type BranchInfo struct {
type Metadata struct {
ID string `json:"id"`
LastModified time.Time `json:"last_modified"`
}
type Backend interface {
io.Closer
// Repos return repo name + default branch
Repos(ctx context.Context, owner string) (map[string]string, error)
// Branches return branch + commit id
Branches(ctx context.Context, owner, repo string) (map[string]*BranchInfo, error)
Meta(ctx context.Context, owner, repo string) (*Metadata, error)
// Open return file or error (error)
Open(ctx context.Context, owner, repo, commit, path string, headers http.Header) (*http.Response, error)
Open(ctx context.Context, owner, repo, id, path string, headers http.Header) (*http.Response, error)
}