Documentation ¶
Index ¶
- func CreateTempFileWithContent(reader io.Reader) (string, error)
- func CreateTempZipFileFrom(bundlesPayload []Fingerprint, zipReader *zip.Reader, ...) (tempFilename string, err error)
- func HandleBodySizeLimits(responseWriter http.ResponseWriter, request *http.Request, ...) (shouldContinue bool)
- func IsNotFoundError(e error) bool
- func ShaSums(filename string) (sha1Sum []byte, sha256Sum []byte, e error)
- type AppStashHandler
- func (handler *AppStashHandler) PostBundles(responseWriter http.ResponseWriter, request *http.Request)
- func (handler *AppStashHandler) PostEntries(responseWriter http.ResponseWriter, request *http.Request)
- func (handler *AppStashHandler) PostMatches(responseWriter http.ResponseWriter, request *http.Request)
- type Blobstore
- type BuildpackMetadata
- type DropletArtifactDeleter
- type Fingerprint
- type MetricsService
- type NoSpaceLeftError
- type NotFoundError
- type NullUpdater
- type ResourceHandler
- func NewResourceHandler(blobstore Blobstore, appStashBlobstore Blobstore, resourceType string, ...) *ResourceHandler
- func NewResourceHandlerWithArtifactDeleter(blobstore Blobstore, appStashBlobstore Blobstore, resourceType string, ...) *ResourceHandler
- func NewResourceHandlerWithUpdater(blobstore Blobstore, appStashBlobstore Blobstore, updater Updater, ...) *ResourceHandler
- func NewResourceHandlerWithUpdaterAndSizeThresholds(blobstore Blobstore, appStashBlobstore Blobstore, updater Updater, ...) *ResourceHandler
- func (handler *ResourceHandler) AddBuildpack(responseWriter http.ResponseWriter, request *http.Request, ...)
- func (handler *ResourceHandler) AddOrReplace(responseWriter http.ResponseWriter, request *http.Request, ...)
- func (handler *ResourceHandler) AddOrReplaceWithDigestInHeader(responseWriter http.ResponseWriter, request *http.Request, ...)
- func (handler *ResourceHandler) BuildpackMetadata(responseWriter http.ResponseWriter, request *http.Request, ...)
- func (handler *ResourceHandler) CopySourceGuid(responseWriter http.ResponseWriter, request *http.Request, ...)
- func (handler *ResourceHandler) Delete(responseWriter http.ResponseWriter, request *http.Request, ...)
- func (handler *ResourceHandler) DeleteDir(responseWriter http.ResponseWriter, request *http.Request, ...)
- func (handler *ResourceHandler) Get(responseWriter http.ResponseWriter, request *http.Request, ...)
- func (handler *ResourceHandler) Head(responseWriter http.ResponseWriter, request *http.Request, ...)
- type ResourceSigner
- type ResponseBody
- type SignResourceHandler
- type StateForbiddenError
- type Updater
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTempZipFileFrom ¶
func CreateTempZipFileFrom(bundlesPayload []Fingerprint, zipReader *zip.Reader, minimumSize, maximumSize uint64, blobstore Blobstore, metricsService MetricsService, logger *zap.SugaredLogger, ) (tempFilename string, err error)
func HandleBodySizeLimits ¶
func HandleBodySizeLimits(responseWriter http.ResponseWriter, request *http.Request, maxBodySizeLimit uint64) (shouldContinue bool)
Note: this changes the request under certain conditions
func IsNotFoundError ¶
Types ¶
type AppStashHandler ¶
type AppStashHandler struct {
// contains filtered or unexported fields
}
func NewAppStashHandlerWithSizeThresholds ¶
func NewAppStashHandlerWithSizeThresholds(blobstore Blobstore, maxBodySizeLimit uint64, minimumSize uint64, maximumSize uint64, metricsService MetricsService) *AppStashHandler
func (*AppStashHandler) PostBundles ¶
func (handler *AppStashHandler) PostBundles(responseWriter http.ResponseWriter, request *http.Request)
func (*AppStashHandler) PostEntries ¶
func (handler *AppStashHandler) PostEntries(responseWriter http.ResponseWriter, request *http.Request)
func (*AppStashHandler) PostMatches ¶
func (handler *AppStashHandler) PostMatches(responseWriter http.ResponseWriter, request *http.Request)
type Blobstore ¶
type Blobstore interface { Exists(path string) (bool, error) // Implementers must return *NotFoundError when the resource cannot be found GetOrRedirect(path string) (body io.ReadCloser, redirectLocation string, err error) // Implementers must return *NotFoundError when the resource cannot be found Get(path string) (body io.ReadCloser, err error) // Implementers must return *NoSpaceLeftError when there's no space left on device. Put(path string, src io.ReadSeeker) error Copy(src, dest string) error Delete(path string) error DeleteDir(prefix string) error }
type BuildpackMetadata ¶
type DropletArtifactDeleter ¶
type Fingerprint ¶
type MetricsService ¶
type NoSpaceLeftError ¶
type NoSpaceLeftError struct {
// contains filtered or unexported fields
}
func NewNoSpaceLeftError ¶
func NewNoSpaceLeftError() *NoSpaceLeftError
type NotFoundError ¶
type NotFoundError struct { MissingKey string // contains filtered or unexported fields }
func NewNotFoundError ¶
func NewNotFoundError() *NotFoundError
Deprecated. Use NewNotFoundErrorWithKey
func NewNotFoundErrorWithKey ¶
func NewNotFoundErrorWithKey(key string) *NotFoundError
func NewNotFoundErrorWithMessage ¶
func NewNotFoundErrorWithMessage(message string) *NotFoundError
Deprecated. Use NewNotFoundErrorWithKey
type NullUpdater ¶
type NullUpdater struct{}
func (*NullUpdater) NotifyProcessingUpload ¶
func (u *NullUpdater) NotifyProcessingUpload(guid string) error
func (*NullUpdater) NotifyUploadFailed ¶
func (u *NullUpdater) NotifyUploadFailed(guid string, e error) error
func (*NullUpdater) NotifyUploadSucceeded ¶
func (u *NullUpdater) NotifyUploadSucceeded(guid string, sha1 string, sha2 string) error
type ResourceHandler ¶
type ResourceHandler struct {
// contains filtered or unexported fields
}
func NewResourceHandler ¶
func NewResourceHandler(blobstore Blobstore, appStashBlobstore Blobstore, resourceType string, metricsService MetricsService, maxBodySizeLimit uint64, shouldProxyGetRequests bool) *ResourceHandler
func NewResourceHandlerWithArtifactDeleter ¶
func NewResourceHandlerWithArtifactDeleter(blobstore Blobstore, appStashBlobstore Blobstore, resourceType string, metricsService MetricsService, maxBodySizeLimit uint64, shouldProxyGetRequests bool, dropletArtifactDeleter DropletArtifactDeleter) *ResourceHandler
func NewResourceHandlerWithUpdater ¶
func NewResourceHandlerWithUpdater(blobstore Blobstore, appStashBlobstore Blobstore, updater Updater, resourceType string, metricsService MetricsService, maxBodySizeLimit uint64, shouldProxyGetRequests bool, dropletArtifactDeleter DropletArtifactDeleter) *ResourceHandler
func NewResourceHandlerWithUpdaterAndSizeThresholds ¶
func NewResourceHandlerWithUpdaterAndSizeThresholds(blobstore Blobstore, appStashBlobstore Blobstore, updater Updater, resourceType string, metricsService MetricsService, maxBodySizeLimit uint64, minimumSize, maximumSize uint64, shouldProxyGetRequests bool, dropletArtifactDeleter DropletArtifactDeleter) *ResourceHandler
func (*ResourceHandler) AddBuildpack ¶
func (handler *ResourceHandler) AddBuildpack(responseWriter http.ResponseWriter, request *http.Request, params map[string]string)
func (*ResourceHandler) AddOrReplace ¶
func (handler *ResourceHandler) AddOrReplace(responseWriter http.ResponseWriter, request *http.Request, params map[string]string)
TODO: instead of params, we could use `identifier string` to make the interface more type-safe.
Here and in the other methods.
func (*ResourceHandler) AddOrReplaceWithDigestInHeader ¶
func (handler *ResourceHandler) AddOrReplaceWithDigestInHeader(responseWriter http.ResponseWriter, request *http.Request, params map[string]string)
TODO: instead of params, we could use `identifier string` to make the interface more type-safe.
Here and in the other methods.
func (*ResourceHandler) BuildpackMetadata ¶
func (handler *ResourceHandler) BuildpackMetadata(responseWriter http.ResponseWriter, request *http.Request, params map[string]string)
func (*ResourceHandler) CopySourceGuid ¶
func (handler *ResourceHandler) CopySourceGuid(responseWriter http.ResponseWriter, request *http.Request, params map[string]string)
func (*ResourceHandler) Delete ¶
func (handler *ResourceHandler) Delete(responseWriter http.ResponseWriter, request *http.Request, params map[string]string)
func (*ResourceHandler) DeleteDir ¶
func (handler *ResourceHandler) DeleteDir(responseWriter http.ResponseWriter, request *http.Request, params map[string]string)
func (*ResourceHandler) Get ¶
func (handler *ResourceHandler) Get(responseWriter http.ResponseWriter, request *http.Request, params map[string]string)
func (*ResourceHandler) Head ¶
func (handler *ResourceHandler) Head(responseWriter http.ResponseWriter, request *http.Request, params map[string]string)
type ResourceSigner ¶
type ResponseBody ¶
type SignResourceHandler ¶
type SignResourceHandler struct {
// contains filtered or unexported fields
}
func NewSignResourceHandler ¶
func NewSignResourceHandler(getResourceSigner, putResourceSigner ResourceSigner) *SignResourceHandler
func (*SignResourceHandler) Sign ¶
func (handler *SignResourceHandler) Sign(responseWriter http.ResponseWriter, request *http.Request, params map[string]string)
type StateForbiddenError ¶
type StateForbiddenError struct {
// contains filtered or unexported fields
}
func NewStateForbiddenError ¶
func NewStateForbiddenError() *StateForbiddenError
Source Files ¶
Click to show internal directories.
Click to hide internal directories.