Documentation ¶
Index ¶
Constants ¶
const ( MetadataPrefix = "X-Amz-Meta-" FrostFSSystemMetadataPrefix = "S3-" AmzMetadataDirective = "X-Amz-Metadata-Directive" AmzTaggingDirective = "X-Amz-Tagging-Directive" AmzVersionID = "X-Amz-Version-Id" AmzTaggingCount = "X-Amz-Tagging-Count" AmzTagging = "X-Amz-Tagging" AmzDeleteMarker = "X-Amz-Delete-Marker" AmzCopySource = "X-Amz-Copy-Source" AmzCopySourceRange = "X-Amz-Copy-Source-Range" AmzDate = "X-Amz-Date" LastModified = "Last-Modified" Date = "Date" ETag = "ETag" ContentType = "Content-Type" ContentMD5 = "Content-Md5" ContentEncoding = "Content-Encoding" Expires = "Expires" ContentLength = "Content-Length" ContentLanguage = "Content-Language" ContentRange = "Content-Range" Connection = "Connection" AcceptRanges = "Accept-Ranges" AmzBucketRegion = "X-Amz-Bucket-Region" ServerInfo = "Server" RetryAfter = "Retry-After" Location = "Location" CacheControl = "Cache-Control" ContentDisposition = "Content-Disposition" Authorization = "Authorization" Action = "Action" IfModifiedSince = "If-Modified-Since" IfUnmodifiedSince = "If-Unmodified-Since" IfMatch = "If-Match" IfNoneMatch = "If-None-Match" AmzContentSha256 = "X-Amz-Content-Sha256" AmzCopyIfModifiedSince = "X-Amz-Copy-Source-If-Modified-Since" AmzCopyIfUnmodifiedSince = "X-Amz-Copy-Source-If-Unmodified-Since" AmzCopyIfMatch = "X-Amz-Copy-Source-If-Match" AmzCopyIfNoneMatch = "X-Amz-Copy-Source-If-None-Match" AmzACL = "X-Amz-Acl" AmzDecodedContentLength = "X-Amz-Decoded-Content-Length" AmzGrantFullControl = "X-Amz-Grant-Full-Control" AmzGrantRead = "X-Amz-Grant-Read" AmzGrantWrite = "X-Amz-Grant-Write" AmzExpectedBucketOwner = "X-Amz-Expected-Bucket-Owner" AmzSourceExpectedBucketOwner = "X-Amz-Source-Expected-Bucket-Owner" AmzBucketObjectLockEnabled = "X-Amz-Bucket-Object-Lock-Enabled" AmzObjectLockLegalHold = "X-Amz-Object-Lock-Legal-Hold" AmzObjectLockMode = "X-Amz-Object-Lock-Mode" AmzObjectLockRetainUntilDate = "X-Amz-Object-Lock-Retain-Until-Date" AmzBypassGovernanceRetention = "X-Amz-Bypass-Governance-Retention" AmzObjectAttributes = "X-Amz-Object-Attributes" AmzMaxParts = "X-Amz-Max-Parts" AmzPartNumberMarker = "X-Amz-Part-Number-Marker" AmzServerSideEncryptionCustomerAlgorithm = "x-amz-server-side-encryption-customer-algorithm" AmzServerSideEncryptionCustomerKey = "x-amz-server-side-encryption-customer-key" AmzServerSideEncryptionCustomerKeyMD5 = "x-amz-server-side-encryption-customer-key-MD5" OwnerID = "X-Owner-Id" ContainerID = "X-Container-Id" ContainerName = "X-Container-Name" ContainerZone = "X-Container-Zone" AccessControlAllowOrigin = "Access-Control-Allow-Origin" AccessControlAllowMethods = "Access-Control-Allow-Methods" AccessControlExposeHeaders = "Access-Control-Expose-Headers" AccessControlAllowHeaders = "Access-Control-Allow-Headers" AccessControlMaxAge = "Access-Control-Max-Age" AccessControlAllowCredentials = "Access-Control-Allow-Credentials" Origin = "Origin" AccessControlRequestMethod = "Access-Control-Request-Method" AccessControlRequestHeaders = "Access-Control-Request-Headers" AwsChunked = "aws-chunked" Vary = "Vary" DefaultLocationConstraint = "default" StreamingContentSHA256 = "STREAMING-AWS4-HMAC-SHA256-PAYLOAD" )
Standard S3 HTTP request/response constants.
const (
QueryVersionID = "versionId"
)
S3 request query params.
Variables ¶
var ResponseModifiers = map[string]string{ "response-content-type": ContentType, "response-content-language": ContentLanguage, "response-expires": Expires, "response-cache-control": CacheControl, "response-content-disposition": ContentDisposition, "response-content-encoding": ContentEncoding, }
ResponseModifiers maps response modifies headers to regular headers.
var SystemMetadata = map[string]struct{}{ Date: {}, CacheControl: {}, ContentDisposition: {}, ContentLength: {}, ContentType: {}, LastModified: {}, ETag: {}, }
Functions ¶
func AttachChi ¶ added in v0.28.0
func AttachChi(api *chi.Mux, domains []string, throttle middleware.ThrottleOpts, h Handler, center auth.Center, log *zap.Logger, appMetrics *metrics.AppMetrics)
func IsSignedStreamingV4 ¶ added in v0.28.0
Types ¶
type Filter ¶ added in v0.28.0
type Filter struct {
// contains filtered or unexported fields
}
func (*Filter) Handler ¶ added in v0.28.0
func (f *Filter) Handler(handler http.HandlerFunc) *Filter
func (*Filter) Headers ¶ added in v0.28.0
Headers is similar to HeadersMatch but accept only header keys, set value to empty string internally.
func (*Filter) HeadersMatch ¶ added in v0.28.0
HeadersMatch adds a matcher for header values. It accepts a sequence of key/value pairs. Values may define variables. Panics if number of parameters is not even. Supports only exact matching. If the value is an empty string, it will match any value if the key is set.
func (*Filter) Queries ¶ added in v0.28.0
Queries is similar to QueriesMatch but accept only query keys, set value to empty string internally.
func (*Filter) QueriesMatch ¶ added in v0.28.0
QueriesMatch adds a matcher for URL query values. It accepts a sequence of key/value pairs. Values may define variables. Panics if number of parameters is not even. Supports only exact matching. If the value is an empty string, it will match any value if the key is set.
type Handler ¶
type Handler interface { HeadObjectHandler(http.ResponseWriter, *http.Request) GetObjectACLHandler(http.ResponseWriter, *http.Request) PutObjectACLHandler(http.ResponseWriter, *http.Request) GetObjectTaggingHandler(http.ResponseWriter, *http.Request) PutObjectTaggingHandler(http.ResponseWriter, *http.Request) DeleteObjectTaggingHandler(http.ResponseWriter, *http.Request) SelectObjectContentHandler(http.ResponseWriter, *http.Request) GetObjectRetentionHandler(http.ResponseWriter, *http.Request) GetObjectLegalHoldHandler(http.ResponseWriter, *http.Request) GetObjectHandler(http.ResponseWriter, *http.Request) GetObjectAttributesHandler(http.ResponseWriter, *http.Request) CopyObjectHandler(http.ResponseWriter, *http.Request) PutObjectRetentionHandler(http.ResponseWriter, *http.Request) PutObjectLegalHoldHandler(http.ResponseWriter, *http.Request) PutObjectHandler(http.ResponseWriter, *http.Request) DeleteObjectHandler(http.ResponseWriter, *http.Request) GetBucketLocationHandler(http.ResponseWriter, *http.Request) GetBucketPolicyHandler(http.ResponseWriter, *http.Request) GetBucketLifecycleHandler(http.ResponseWriter, *http.Request) GetBucketEncryptionHandler(http.ResponseWriter, *http.Request) GetBucketACLHandler(http.ResponseWriter, *http.Request) PutBucketACLHandler(http.ResponseWriter, *http.Request) GetBucketCorsHandler(http.ResponseWriter, *http.Request) PutBucketCorsHandler(http.ResponseWriter, *http.Request) DeleteBucketCorsHandler(http.ResponseWriter, *http.Request) GetBucketWebsiteHandler(http.ResponseWriter, *http.Request) GetBucketAccelerateHandler(http.ResponseWriter, *http.Request) GetBucketRequestPaymentHandler(http.ResponseWriter, *http.Request) GetBucketLoggingHandler(http.ResponseWriter, *http.Request) GetBucketReplicationHandler(http.ResponseWriter, *http.Request) GetBucketTaggingHandler(http.ResponseWriter, *http.Request) DeleteBucketWebsiteHandler(http.ResponseWriter, *http.Request) DeleteBucketTaggingHandler(http.ResponseWriter, *http.Request) GetBucketObjectLockConfigHandler(http.ResponseWriter, *http.Request) GetBucketVersioningHandler(http.ResponseWriter, *http.Request) GetBucketNotificationHandler(http.ResponseWriter, *http.Request) ListenBucketNotificationHandler(http.ResponseWriter, *http.Request) ListObjectsV2MHandler(http.ResponseWriter, *http.Request) ListObjectsV2Handler(http.ResponseWriter, *http.Request) ListBucketObjectVersionsHandler(http.ResponseWriter, *http.Request) ListObjectsV1Handler(http.ResponseWriter, *http.Request) PutBucketLifecycleHandler(http.ResponseWriter, *http.Request) PutBucketEncryptionHandler(http.ResponseWriter, *http.Request) PutBucketPolicyHandler(http.ResponseWriter, *http.Request) PutBucketObjectLockConfigHandler(http.ResponseWriter, *http.Request) PutBucketTaggingHandler(http.ResponseWriter, *http.Request) PutBucketVersioningHandler(http.ResponseWriter, *http.Request) PutBucketNotificationHandler(http.ResponseWriter, *http.Request) CreateBucketHandler(http.ResponseWriter, *http.Request) HeadBucketHandler(http.ResponseWriter, *http.Request) PostObject(http.ResponseWriter, *http.Request) DeleteMultipleObjectsHandler(http.ResponseWriter, *http.Request) DeleteBucketPolicyHandler(http.ResponseWriter, *http.Request) DeleteBucketLifecycleHandler(http.ResponseWriter, *http.Request) DeleteBucketEncryptionHandler(http.ResponseWriter, *http.Request) DeleteBucketHandler(http.ResponseWriter, *http.Request) ListBucketsHandler(http.ResponseWriter, *http.Request) Preflight(w http.ResponseWriter, r *http.Request) AppendCORSHeaders(w http.ResponseWriter, r *http.Request) CreateMultipartUploadHandler(http.ResponseWriter, *http.Request) UploadPartHandler(http.ResponseWriter, *http.Request) UploadPartCopy(w http.ResponseWriter, r *http.Request) CompleteMultipartUploadHandler(http.ResponseWriter, *http.Request) AbortMultipartUploadHandler(http.ResponseWriter, *http.Request) ListPartsHandler(w http.ResponseWriter, r *http.Request) ListMultipartUploadsHandler(http.ResponseWriter, *http.Request) ResolveBucket(ctx context.Context, bucket string) (*data.BucketInfo, error) }
Handler is an S3 API handler interface.
type HandlerFilters ¶ added in v0.28.0
type HandlerFilters struct {
// contains filtered or unexported fields
}
func NewHandlerFilter ¶ added in v0.28.0
func NewHandlerFilter() *HandlerFilters
func (*HandlerFilters) Add ¶ added in v0.28.0
func (hf *HandlerFilters) Add(filter *Filter) *HandlerFilters
func (*HandlerFilters) DefaultHandler ¶ added in v0.28.0
func (hf *HandlerFilters) DefaultHandler(handler http.HandlerFunc) *HandlerFilters
func (*HandlerFilters) ServeHTTP ¶ added in v0.28.0
func (hf *HandlerFilters) ServeHTTP(w http.ResponseWriter, r *http.Request)
type HostBucketRouter ¶ added in v0.28.0
type HostBucketRouter struct {
// contains filtered or unexported fields
}
func NewHostBucketRouter ¶ added in v0.28.0
func NewHostBucketRouter(bktParam string) HostBucketRouter
func (*HostBucketRouter) Default ¶ added in v0.28.0
func (hr *HostBucketRouter) Default(router chi.Router)
func (HostBucketRouter) Map ¶ added in v0.28.0
func (hr HostBucketRouter) Map(host string, h chi.Router)
func (HostBucketRouter) ServeHTTP ¶ added in v0.28.0
func (hr HostBucketRouter) ServeHTTP(w http.ResponseWriter, r *http.Request)