Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CASHandler ¶
type CASHandler struct {
Local *repository.LocalRepository
Client *http.Client
Upstreams []string
AppCtx context.Context // Application context (from Cobra), not request context
// contains filtered or unexported fields
}
func NewCASHandler ¶
func NewCASHandler(local *repository.LocalRepository, client *http.Client, upstreams []string, appCtx context.Context) *CASHandler
func (*CASHandler) Serve ¶
func (h *CASHandler) Serve(w http.ResponseWriter, r *http.Request, id utils.Hash, candidateSources []string)
Serve handles the fetch logic for a given hash ID with candidate source URLs. It checks the local cache first, then tries upstreams followed by the candidate sources. candidateSources are also forwarded as X-Source-Urls to upstreams.
func (*CASHandler) ServeHTTP ¶
func (h *CASHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type CASLookupHandler ¶
type CASLookupHandler struct {
CAS *CASHandler
Sources *SourceMap
}
CASLookupHandler serves CAS requests using a pre-populated source map instead of X-Source-Urls headers.
func NewCASLookupHandler ¶
func NewCASLookupHandler(cas *CASHandler, sources *SourceMap) *CASLookupHandler
func (*CASLookupHandler) ServeHTTP ¶
func (h *CASLookupHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.