Documentation
¶
Overview ¶
Package lfs owns the generated Git LFS protocol conversions.
Index ¶
- func FromGeneratedCandidate(value generated.DrsObjectCandidate) objects.Candidate
- func GetBaseURL(ctx context.Context) string
- func LFSRequestMiddleware(opts Options) lfsapi.StrictMiddlewareFunc
- func RegisterLFSRoutes(router fiber.Router, deps Dependencies, opts ...Options)
- func ResetLFSLimitersForTest()
- func ValidateLFSMetadataHeaders(c fiber.Ctx) bool
- func ValidateLFSRequestHeaders(c fiber.Ctx, requireAccept, requireContentType bool) bool
- func WithBaseURL(ctx context.Context, baseURL string) context.Context
- func WriteLFSError(c fiber.Ctx, status int, message string, challenge bool) error
- type Dependencies
- type LFSServer
- func (s *LFSServer) LfsBatch(ctx context.Context, request lfsapi.LfsBatchRequestObject) (lfsapi.LfsBatchResponseObject, error)
- func (s *LFSServer) LfsStageMetadata(ctx context.Context, request lfsapi.LfsStageMetadataRequestObject) (lfsapi.LfsStageMetadataResponseObject, error)
- func (s *LFSServer) LfsUploadProxy(ctx context.Context, request lfsapi.LfsUploadProxyRequestObject) (lfsapi.LfsUploadProxyResponseObject, error)
- func (s *LFSServer) LfsVerify(ctx context.Context, request lfsapi.LfsVerifyRequestObject) (lfsapi.LfsVerifyResponseObject, error)
- type Options
- type PartUploader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromGeneratedCandidate ¶
func FromGeneratedCandidate(value generated.DrsObjectCandidate) objects.Candidate
FromGeneratedCandidate converts the LFS metadata shape to the plain value stored by the transfer workflow. The selected fields preserve the legacy DRS candidate JSON written by the previous LFS adapter.
func GetBaseURL ¶
GetBaseURL returns the request base URL previously attached by the route adapter.
func LFSRequestMiddleware ¶
func LFSRequestMiddleware(opts Options) lfsapi.StrictMiddlewareFunc
LFSRequestMiddleware applies the legacy per-operation media and limiter checks before generated strict decoding invokes the handler.
func RegisterLFSRoutes ¶
func RegisterLFSRoutes(router fiber.Router, deps Dependencies, opts ...Options)
func ResetLFSLimitersForTest ¶
func ResetLFSLimitersForTest()
ResetLFSLimitersForTest clears the process-global limiter windows.
func ValidateLFSMetadataHeaders ¶
ValidateLFSMetadataHeaders accepts both content types supported by the generated metadata request decoder. The other LFS operations require the vendor media type exclusively.
func ValidateLFSRequestHeaders ¶
ValidateLFSRequestHeaders validates the media contract for a strict LFS operation. It intentionally accepts */* for clients that use a generic Accept header.
func WithBaseURL ¶
WithBaseURL attaches the Fiber request base URL to a request context.
Types ¶
type Dependencies ¶
type Dependencies struct {
ObjectService *objectrecords.Service
TransferService *transfers.Service
PendingStore transferlfs.PendingStore
FileCounters usage.FileCounterRecorder
Credentials buckets.CredentialReader
PartUploader PartUploader
}
type LFSServer ¶
type LFSServer struct {
// contains filtered or unexported fields
}
func NewLFSServer ¶
func NewLFSServer(deps Dependencies, opts Options) *LFSServer
func (*LFSServer) LfsBatch ¶
func (s *LFSServer) LfsBatch(ctx context.Context, request lfsapi.LfsBatchRequestObject) (lfsapi.LfsBatchResponseObject, error)
func (*LFSServer) LfsStageMetadata ¶
func (s *LFSServer) LfsStageMetadata(ctx context.Context, request lfsapi.LfsStageMetadataRequestObject) (lfsapi.LfsStageMetadataResponseObject, error)
func (*LFSServer) LfsUploadProxy ¶
func (s *LFSServer) LfsUploadProxy(ctx context.Context, request lfsapi.LfsUploadProxyRequestObject) (lfsapi.LfsUploadProxyResponseObject, error)
func (*LFSServer) LfsVerify ¶
func (s *LFSServer) LfsVerify(ctx context.Context, request lfsapi.LfsVerifyRequestObject) (lfsapi.LfsVerifyResponseObject, error)