Documentation
¶
Overview ¶
Package gitlfs serves hosted Git LFS repositories: the batch API with the basic transfer adapter (https://github.com/git-lfs/git-lfs/blob/main/docs/api). Objects are immutable blobs named by their SHA-256 and live under /repos/gitlfs/<repo>; a client points lfs.url at that URL.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPHandler ¶
HTTPHandler serves the Git LFS protocol of hosted repositories.
func NewHTTPHandler ¶
func NewHTTPHandler(log *logger.Logger, db HTTPStore, blobStore storage.BlobStore, baseURL string) *HTTPHandler
NewHTTPHandler returns a handler for repositories of format gitlfs.
func (*HTTPHandler) RegisterRepoRoutes ¶
func (h *HTTPHandler) RegisterRepoRoutes(r chi.Router)
RegisterRepoRoutes registers the protocol routes on the repository's sub-router (/repos/gitlfs/{name}); the caller owns the path prefix.
func (*HTTPHandler) RegisterRoutes ¶
func (h *HTTPHandler) RegisterRoutes(r chi.Router, prefix string)
RegisterRoutes registers the protocol routes under prefix.
type HTTPStore ¶
type HTTPStore interface {
quarantine.Checker
BlobReferenceCount(ctx context.Context, sha256 string) (int, error)
CountFileDownload(fileID string)
DecrementStorageUsage(ctx context.Context, repoID string, sizeBytes int64, artifactCount int) error
GetGitLFSObjects(ctx context.Context, repoID string, oids []string) ([]*models.GitLFSObject, error)
GetOrCreateStorageQuota(ctx context.Context, repoID string) (*models.StorageQuota, error)
GetRawArtifact(ctx context.Context, repoID string, path string) (*models.RawArtifact, error)
GetRepositoryByName(ctx context.Context, name string) (*models.Repository, error)
PutGitLFSObject(ctx context.Context, obj *models.GitLFSObject) error
ReserveStorageUsage(ctx context.Context, repoID string, sizeBytes int64, artifactCount int) (bool, error)
UpsertRawArtifact(ctx context.Context, artifact *models.RawArtifact) error
}
HTTPStore is the part of the database HTTPHandler needs.