Documentation ¶
Index ¶
- Constants
- Variables
- func CheckValidBucketName(bucketName string) (err error)
- func CreateListObjectsResponse(bucketName string, request *s3.ListObjectsRequest, ...) (response datatype.ListObjectsResponse)
- func EncodeResponse(response interface{}) []byte
- func GenerateCompleteMultipartUploadResponse(bucket, key, location, etag string) CompleteMultipartUploadResponse
- func GenerateCopyObjectPartResponse(etag string, lastModified int64) CopyObjectPartResponse
- func GenerateCopyObjectResponse(etag string, lastModified time.Time) CopyObjectResponse
- func GenerateInitiateMultipartUploadResponse(bucket, key, uploadID string) InitiateMultipartUploadResponse
- func GetFinalError(err error, errorCode int32) error
- func GetLocation(r *http.Request) string
- func HandleS3Error(response *restful.Response, request *restful.Request, err error, errCode int32) error
- func HasHeader(request *restful.Request, name string) bool
- func IsQuery(request *restful.Request, name string) bool
- func ReadBody(r *restful.Request) []byte
- func RegisterRouter(ws *restful.WebService)
- func SetObjectHeaders(response *restful.Response, object *pb.Object, expTime int64, ruleId string, ...)
- func UrlEncodeAsAwsS3(s string) string
- func WriteApiErrorResponse(response *restful.Response, request *restful.Request, status int, ...)
- func WriteErrorResponse(response *restful.Response, request *restful.Request, err error)
- func WriteErrorResponseHeaders(response *restful.Response, err error)
- func WriteErrorResponseNoHeader(response *restful.Response, request *restful.Request, err error, ...)
- func WriteErrorResponseWithResource(response *restful.Response, request *restful.Request, err error, ...)
- func WriteSuccessNoContent(response *restful.Response)
- func WriteSuccessResponse(response *restful.Response, data []byte)
- type APIService
- func (s *APIService) AbortMultipartUpload(request *restful.Request, response *restful.Response)
- func (s *APIService) BucketAclGet(request *restful.Request, response *restful.Response)
- func (s *APIService) BucketAclPut(request *restful.Request, response *restful.Response)
- func (s *APIService) BucketDelete(request *restful.Request, response *restful.Response)
- func (s *APIService) BucketGet(request *restful.Request, response *restful.Response)
- func (s *APIService) BucketLifecycleDelete(request *restful.Request, response *restful.Response)
- func (s *APIService) BucketLifecycleGet(request *restful.Request, response *restful.Response)
- func (s *APIService) BucketLifecyclePut(request *restful.Request, response *restful.Response)
- func (s *APIService) BucketPut(request *restful.Request, response *restful.Response)
- func (s *APIService) BucketSSEPut(request *restful.Request, response *restful.Response)
- func (s *APIService) BucketVersioningPut(request *restful.Request, response *restful.Response)
- func (s *APIService) CompleteMultipartUpload(request *restful.Request, response *restful.Response)
- func (s *APIService) GetBackendIdFromTier(ctx context.Context, tierName string) string
- func (s *APIService) GetStorageClasses(request *restful.Request, response *restful.Response)
- func (s *APIService) HeadBucket(request *restful.Request, response *restful.Response)
- func (s *APIService) HeadObject(request *restful.Request, response *restful.Response)
- func (s *APIService) ListBucketUploadRecords(request *restful.Request, response *restful.Response)
- func (s *APIService) ListBuckets(request *restful.Request, response *restful.Response)
- func (s *APIService) ListObjectParts(request *restful.Request, response *restful.Response)
- func (s *APIService) MultiPartUploadInit(request *restful.Request, response *restful.Response)
- func (s *APIService) ObjectAclGet(request *restful.Request, response *restful.Response)
- func (s *APIService) ObjectAclPut(request *restful.Request, response *restful.Response)
- func (s *APIService) ObjectCopy(request *restful.Request, response *restful.Response)
- func (s *APIService) ObjectDelete(request *restful.Request, response *restful.Response)
- func (s *APIService) ObjectGet(request *restful.Request, response *restful.Response)
- func (s *APIService) ObjectPartCopy(request *restful.Request, response *restful.Response)
- func (s *APIService) ObjectPost(request *restful.Request, response *restful.Response)
- func (s *APIService) ObjectPut(request *restful.Request, response *restful.Response)
- func (s *APIService) RestoreObject(request *restful.Request, response *restful.Response)
- func (s *APIService) RouteBucketDelete(request *restful.Request, response *restful.Response)
- func (s *APIService) RouteBucketGet(request *restful.Request, response *restful.Response)
- func (s *APIService) RouteBucketHead(request *restful.Request, response *restful.Response)
- func (s *APIService) RouteBucketPut(request *restful.Request, response *restful.Response)
- func (s *APIService) RouteObjectDelete(request *restful.Request, response *restful.Response)
- func (s *APIService) RouteObjectGet(request *restful.Request, response *restful.Response)
- func (s *APIService) RouteObjectHead(request *restful.Request, response *restful.Response)
- func (s *APIService) RouteObjectPost(request *restful.Request, response *restful.Response)
- func (s *APIService) RouteObjectPut(request *restful.Request, response *restful.Response)
- func (s *APIService) UploadPart(request *restful.Request, response *restful.Response)
- type ApiErrorResponse
Constants ¶
const ( DuplicateRuleIDError = "error: PUT bucket lifecycle failed because the ruleId %s is duplicate." NoRequestBodyLifecycle = "error: No request body specified for creating lifecycle configuration" NoRequestBodySSE = "error: No request body specified for creating SSE configuration" MoreThanOneExpirationAction = "error: More than one expiration action is not permitted in one rule" DaysInStorageClassBeforeExpiration = "error: minimum days for an object in the current storage class should be less than Expiration Days" DaysInStorageClassBeforeTransition = "error: minimum days for an object in the current storage class is less before transition action" NoRuleIDForLifecycleDelete = "error: No rule ID specified to delete from lifecycle configuration" WrongRuleIDForLifecycleDelete = "error: The rule ID which is specified for delete does not exist" InvalidTier = "error: Invalid tier" InvalidExpireDays = "error: Days for Expiring object must not be less than %d" InvalidTransistionDays = "error: days for transitioning object to tier_%d must not be less than %d" TooMuchLCRuls = "error: number of rules should not more than %d" InvalidRuleId = "error: Invalid rule ID" )
const ( AWS_TYPE = "aws-s3" AZURE_TYPE = "azure-blob" GCP_TYPE = "gcp-s3" AWS_DEFAULT_RESTORE_DAYS = 5 AWS_DEFAULT_RESTORE_TIER = "Expedited" AZURE_DEFAULT_RESTORE_CLASS = "Hot" AWS_GLACIER = "GLACIER" ARCHIVE = "Archive" )
FIXME: This const values are declared for tiering feature. Later this can be read from config file
const ( TypePostFormData int = iota TypeInitMultipartUpload TypeCompleteMultipartUpload RestoreObject )
const ( TypePutObj int = iota TypePutACL TypeCopyObj TypeCopyPart TypeUploadPart TypeTagging )
const ( MICRO_ENVIRONMENT = "MICRO_ENVIRONMENT" K8S = "k8s" )
const (
AWSErrCodeInvalidArgument = "InvalidArgument"
)
const IdLimiteLen int = 255
const (
TrueValue = "True"
)
Variables ¶
var ChunkSize int = 2048
var ClassAndTier map[string]int32
Map from storage calss to tier
var ClassAndTier1 map[string]int32
Map from storage calss to tier
var CommonS3ResponseHeaders = []string{"Content-Length", "Content-Type", "Connection", "Date", "ETag", "Server",
"x-amz-delete-marker", "x-amz-id-2", "x-amz-request-id", "x-amz-version-id"}
Refer: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonResponseHeaders.html
var ValidSuccessActionStatus = []string{"200", "201", "204"}
handle post object according to 'https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST.html'
Functions ¶
func CheckValidBucketName ¶ added in v0.6.3
CheckValidBucketName - checks if we have a valid input bucket name.
func CreateListObjectsResponse ¶ added in v0.6.3
func CreateListObjectsResponse(bucketName string, request *s3.ListObjectsRequest, listRsp *s3.ListObjectsResponse) (response datatype.ListObjectsResponse)
this function refers to GenerateListObjectsResponse in api-response.go from Minio Cloud Storage.
func EncodeResponse ¶ added in v0.6.3
func EncodeResponse(response interface{}) []byte
Encodes the response headers into XML format.
func GenerateCompleteMultipartUploadResponse ¶ added in v0.6.3
func GenerateCompleteMultipartUploadResponse(bucket, key, location, etag string) CompleteMultipartUploadResponse
GenerateCompleteMultipartUploadResponse
func GenerateCopyObjectPartResponse ¶ added in v0.8.0
func GenerateCopyObjectResponse ¶ added in v0.6.3
GenerateCopyObjectResponse
func GenerateInitiateMultipartUploadResponse ¶ added in v0.6.3
func GenerateInitiateMultipartUploadResponse(bucket, key, uploadID string) InitiateMultipartUploadResponse
GenerateInitiateMultipartUploadResponse
func GetFinalError ¶ added in v0.6.3
func GetLocation ¶ added in v0.6.3
getLocation get URL location.
func HandleS3Error ¶ added in v0.6.3
func RegisterRouter ¶
func RegisterRouter(ws *restful.WebService)
RegisterRouter - route request to appropriate method
func SetObjectHeaders ¶ added in v0.6.3
func SetObjectHeaders(response *restful.Response, object *pb.Object, expTime int64, ruleId string, contentRange *HttpRange)
Write object header, expTime and ruleId only used for HeadObject
func UrlEncodeAsAwsS3 ¶ added in v0.12.0
func WriteApiErrorResponse ¶ added in v0.6.3
func WriteErrorResponse ¶ added in v0.6.3
func WriteErrorResponse(response *restful.Response, request *restful.Request, err error)
writeErrorResponse write error headers w http.ResponseWriter, r *http.Request
func WriteErrorResponseHeaders ¶ added in v0.6.3
func WriteErrorResponseHeaders(response *restful.Response, err error)
func WriteErrorResponseNoHeader ¶ added in v0.6.3
func WriteErrorResponseWithResource ¶ added in v0.6.3
func WriteSuccessNoContent ¶ added in v0.6.3
func WriteSuccessNoContent(response *restful.Response)
writeSuccessNoContent write success headers with http status 204
func WriteSuccessResponse ¶ added in v0.6.3
func WriteSuccessResponse(response *restful.Response, data []byte)
WriteSuccessResponse write success headers and response if any.
Types ¶
type APIService ¶
type APIService struct {
// contains filtered or unexported fields
}
func NewAPIService ¶
func NewAPIService(c client.Client) *APIService
func (*APIService) AbortMultipartUpload ¶
func (s *APIService) AbortMultipartUpload(request *restful.Request, response *restful.Response)
func (*APIService) BucketAclGet ¶ added in v0.6.3
func (s *APIService) BucketAclGet(request *restful.Request, response *restful.Response)
func (*APIService) BucketAclPut ¶ added in v0.6.3
func (s *APIService) BucketAclPut(request *restful.Request, response *restful.Response)
func (*APIService) BucketDelete ¶
func (s *APIService) BucketDelete(request *restful.Request, response *restful.Response)
func (*APIService) BucketGet ¶
func (s *APIService) BucketGet(request *restful.Request, response *restful.Response)
func (*APIService) BucketLifecycleDelete ¶ added in v0.5.3
func (s *APIService) BucketLifecycleDelete(request *restful.Request, response *restful.Response)
func (*APIService) BucketLifecycleGet ¶ added in v0.5.3
func (s *APIService) BucketLifecycleGet(request *restful.Request, response *restful.Response)
Function for GET Bucket Lifecycle API
func (*APIService) BucketLifecyclePut ¶ added in v0.5.3
func (s *APIService) BucketLifecyclePut(request *restful.Request, response *restful.Response)
func (*APIService) BucketPut ¶
func (s *APIService) BucketPut(request *restful.Request, response *restful.Response)
func (*APIService) BucketSSEPut ¶ added in v0.6.3
func (s *APIService) BucketSSEPut(request *restful.Request, response *restful.Response)
func (*APIService) BucketVersioningPut ¶ added in v0.6.3
func (s *APIService) BucketVersioningPut(request *restful.Request, response *restful.Response)
func (*APIService) CompleteMultipartUpload ¶
func (s *APIService) CompleteMultipartUpload(request *restful.Request, response *restful.Response)
func (*APIService) GetBackendIdFromTier ¶ added in v1.3.2
func (s *APIService) GetBackendIdFromTier(ctx context.Context, tierName string) string
func (*APIService) GetStorageClasses ¶ added in v0.5.2
func (s *APIService) GetStorageClasses(request *restful.Request, response *restful.Response)
func (*APIService) HeadBucket ¶ added in v0.7.0
func (s *APIService) HeadBucket(request *restful.Request, response *restful.Response)
func (*APIService) HeadObject ¶ added in v0.7.0
func (s *APIService) HeadObject(request *restful.Request, response *restful.Response)
func (*APIService) ListBucketUploadRecords ¶ added in v0.6.3
func (s *APIService) ListBucketUploadRecords(request *restful.Request, response *restful.Response)
func (*APIService) ListBuckets ¶
func (s *APIService) ListBuckets(request *restful.Request, response *restful.Response)
func (*APIService) ListObjectParts ¶ added in v0.6.3
func (s *APIService) ListObjectParts(request *restful.Request, response *restful.Response)
func (*APIService) MultiPartUploadInit ¶
func (s *APIService) MultiPartUploadInit(request *restful.Request, response *restful.Response)
func (*APIService) ObjectAclGet ¶ added in v0.6.3
func (s *APIService) ObjectAclGet(request *restful.Request, response *restful.Response)
func (*APIService) ObjectAclPut ¶ added in v0.6.3
func (s *APIService) ObjectAclPut(request *restful.Request, response *restful.Response)
func (*APIService) ObjectCopy ¶ added in v0.6.3
func (s *APIService) ObjectCopy(request *restful.Request, response *restful.Response)
ObjectCopy copy object from http header x-amz-copy-source
func (*APIService) ObjectDelete ¶
func (s *APIService) ObjectDelete(request *restful.Request, response *restful.Response)
func (*APIService) ObjectGet ¶
func (s *APIService) ObjectGet(request *restful.Request, response *restful.Response)
GetObjectHandler - GET Object
func (*APIService) ObjectPartCopy ¶ added in v0.8.0
func (s *APIService) ObjectPartCopy(request *restful.Request, response *restful.Response)
ObjectPartCopy copy object from http header x-amz-copy-source as a part for multipart
func (*APIService) ObjectPost ¶ added in v0.8.0
func (s *APIService) ObjectPost(request *restful.Request, response *restful.Response)
func (*APIService) ObjectPut ¶
func (s *APIService) ObjectPut(request *restful.Request, response *restful.Response)
ObjectPut -
func (*APIService) RestoreObject ¶ added in v1.2.0
func (s *APIService) RestoreObject(request *restful.Request, response *restful.Response)
Object Restore from Archival storage
func (*APIService) RouteBucketDelete ¶ added in v0.5.3
func (s *APIService) RouteBucketDelete(request *restful.Request, response *restful.Response)
func (*APIService) RouteBucketGet ¶ added in v0.5.3
func (s *APIService) RouteBucketGet(request *restful.Request, response *restful.Response)
func (*APIService) RouteBucketHead ¶ added in v0.6.3
func (s *APIService) RouteBucketHead(request *restful.Request, response *restful.Response)
func (*APIService) RouteBucketPut ¶
func (s *APIService) RouteBucketPut(request *restful.Request, response *restful.Response)
func (*APIService) RouteObjectDelete ¶ added in v0.3.4
func (s *APIService) RouteObjectDelete(request *restful.Request, response *restful.Response)
func (*APIService) RouteObjectGet ¶ added in v0.6.3
func (s *APIService) RouteObjectGet(request *restful.Request, response *restful.Response)
func (*APIService) RouteObjectHead ¶ added in v0.6.3
func (s *APIService) RouteObjectHead(request *restful.Request, response *restful.Response)
func (*APIService) RouteObjectPost ¶ added in v0.6.3
func (s *APIService) RouteObjectPost(request *restful.Request, response *restful.Response)
func (*APIService) RouteObjectPut ¶
func (s *APIService) RouteObjectPut(request *restful.Request, response *restful.Response)
func (*APIService) UploadPart ¶
func (s *APIService) UploadPart(request *restful.Request, response *restful.Response)
Source Files ¶
- abortmultipartupload.go
- acl.go
- api-headers.go
- api-response.go
- bucketacl.go
- bucketdelete.go
- bucketget.go
- bucketlifecycledelete.go
- bucketlifecycleget.go
- bucketlifecycleput.go
- bucketload.go
- bucketput.go
- bucketsseput.go
- bucketversioningput.go
- completemultipartupload.go
- handler-utils.go
- lifecycleerrorcodes.go
- listbuckets.go
- listbucketuploadrecrds.go
- listobjectparts.go
- liststorageclasses.go
- multipartuploadinit.go
- object-handlers-common.go
- object-utils.go
- objectacl.go
- objectcopy.go
- objectdelete.go
- objectget.go
- objectpartcopy.go
- objectpost.go
- objectput.go
- objectrestore.go
- routbucketdelete.go
- routbucketget.go
- routbuckethead.go
- routbucketput.go
- routeobjectdelete.go
- routeobjectget.go
- routeobjecthead.go
- routeobjectpost.go
- routeobjectput.go
- router.go
- service.go
- uploadpart.go
- utils.go