operations

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2020 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreateMultipartUploadQueryParam   = "uploads"
	CompleteMultipartUploadQueryParam = "uploadId"
)
View Source
const (
	CopySourceHeader     = "x-amz-copy-source"
	QueryParamUploadID   = "uploadId"
	QueryParamPartNumber = "partNumber"
)
View Source
const (
	ListObjectMaxKeys = 1000
)
View Source
const StorageClassHeader = "x-amz-storage-class"

Variables

This section is empty.

Functions

func DecodeXMLBody

func DecodeXMLBody(reader io.Reader, entity interface{}) error

func EncodeResponse

func EncodeResponse(w http.ResponseWriter, entity interface{}, statusCode int) error

func EncodeXMLBytes

func EncodeXMLBytes(w http.ResponseWriter, t []byte, statusCode int) error

func StorageClassFromHeader

func StorageClassFromHeader(header http.Header) *string

Types

type ActionIncr

type ActionIncr func(string)

type AuthenticatedOperation

type AuthenticatedOperation struct {
	*Operation
	Principal string
}

type AuthenticatedOperationHandler

type AuthenticatedOperationHandler interface {
	RequiredPermissions(request *http.Request) ([]permissions.Permission, error)
	Handle(op *AuthenticatedOperation)
}

type BranchOperationHandler

type BranchOperationHandler interface {
	RequiredPermissions(request *http.Request, repository, branch string) ([]permissions.Permission, error)
	Handle(op *RefOperation)
}

type DeleteObject

type DeleteObject struct{}

func (*DeleteObject) Handle

func (controller *DeleteObject) Handle(o *PathOperation)

func (*DeleteObject) HandleAbortMultipartUpload

func (controller *DeleteObject) HandleAbortMultipartUpload(o *PathOperation)

func (*DeleteObject) RequiredPermissions

func (controller *DeleteObject) RequiredPermissions(_ *http.Request, repoID, _, path string) ([]permissions.Permission, error)

type DeleteObjects

type DeleteObjects struct{}

func (*DeleteObjects) Handle

func (controller *DeleteObjects) Handle(o *RepoOperation)

func (*DeleteObjects) RequiredPermissions

func (controller *DeleteObjects) RequiredPermissions(_ *http.Request, _ string) ([]permissions.Permission, error)

type GetObject

type GetObject struct{}

func (*GetObject) Handle

func (controller *GetObject) Handle(o *PathOperation)

func (*GetObject) RequiredPermissions

func (controller *GetObject) RequiredPermissions(_ *http.Request, repoID, _, path string) ([]permissions.Permission, error)

type HeadBucket

type HeadBucket struct{}

func (*HeadBucket) Handle

func (controller *HeadBucket) Handle(o *RepoOperation)

func (*HeadBucket) RequiredPermissions

func (controller *HeadBucket) RequiredPermissions(_ *http.Request, repoID string) ([]permissions.Permission, error)

type HeadObject

type HeadObject struct{}

func (*HeadObject) Handle

func (controller *HeadObject) Handle(o *PathOperation)

func (*HeadObject) RequiredPermissions

func (controller *HeadObject) RequiredPermissions(request *http.Request, repoID, branchID, path string) ([]permissions.Permission, error)

type ListBuckets

type ListBuckets struct{}

func (*ListBuckets) Handle

func (controller *ListBuckets) Handle(o *AuthenticatedOperation)

func (*ListBuckets) RequiredPermissions

func (controller *ListBuckets) RequiredPermissions(_ *http.Request) ([]permissions.Permission, error)

type ListObjects

type ListObjects struct{}

func (*ListObjects) Handle

func (controller *ListObjects) Handle(o *RepoOperation)

func (*ListObjects) ListV1

func (controller *ListObjects) ListV1(o *RepoOperation)

func (*ListObjects) ListV2

func (controller *ListObjects) ListV2(o *RepoOperation)

func (*ListObjects) RequiredPermissions

func (controller *ListObjects) RequiredPermissions(request *http.Request, repoID string) ([]permissions.Permission, error)

type Operation

type Operation struct {
	Request        *http.Request
	ResponseWriter http.ResponseWriter
	Region         string
	FQDN           string
	Cataloger      catalog.Cataloger
	BlockStore     block.Adapter
	Auth           simulator.GatewayAuthService
	Incr           ActionIncr
	DedupCleaner   *dedup.Cleaner
}

func (*Operation) AddLogFields

func (o *Operation) AddLogFields(fields logging.Fields)

func (*Operation) Context

func (o *Operation) Context() context.Context

func (*Operation) EncodeError

func (o *Operation) EncodeError(e errors.APIError)

func (*Operation) EncodeResponse

func (o *Operation) EncodeResponse(entity interface{}, statusCode int)

func (*Operation) EncodeXMLBytes

func (o *Operation) EncodeXMLBytes(t []byte, statusCode int)

func (*Operation) Log

func (o *Operation) Log() logging.Logger

func (*Operation) RequestID added in v0.8.2

func (o *Operation) RequestID() string

func (*Operation) SetHeader

func (o *Operation) SetHeader(key, value string)

SetHeader sets a header on the response while preserving its case

func (*Operation) SetHeaders

func (o *Operation) SetHeaders(headers map[string]string)

SetHeaders sets a map of headers on the response while preserving the header's case

type OperationHandler

type OperationHandler interface {
	RequiredPermissions(request *http.Request) ([]permissions.Permission, error)
	Handle(op *Operation)
}

type PathOperation

type PathOperation struct {
	*RefOperation
	Path string
}

func (*PathOperation) EncodeError

func (o *PathOperation) EncodeError(err errors.APIError)

type PathOperationHandler

type PathOperationHandler interface {
	RequiredPermissions(request *http.Request, repository, branch, path string) ([]permissions.Permission, error)
	Handle(op *PathOperation)
}

type PostObject

type PostObject struct{}

func (*PostObject) Handle

func (controller *PostObject) Handle(o *PathOperation)

func (*PostObject) HandleCompleteMultipartUpload

func (controller *PostObject) HandleCompleteMultipartUpload(o *PathOperation)

func (*PostObject) HandleCreateMultipartUpload

func (controller *PostObject) HandleCreateMultipartUpload(o *PathOperation)

func (*PostObject) RequiredPermissions

func (controller *PostObject) RequiredPermissions(_ *http.Request, repoID, _, path string) ([]permissions.Permission, error)

type PutObject

type PutObject struct{}

func (*PutObject) Handle

func (controller *PutObject) Handle(o *PathOperation)

func (*PutObject) HandleCopy

func (controller *PutObject) HandleCopy(o *PathOperation, copySource string)

func (*PutObject) HandleUploadPart

func (controller *PutObject) HandleUploadPart(o *PathOperation)

func (*PutObject) RequiredPermissions

func (controller *PutObject) RequiredPermissions(_ *http.Request, repoID, _, path string) ([]permissions.Permission, error)

type RefOperation

type RefOperation struct {
	*RepoOperation
	Reference string
}

type RepoOperation

type RepoOperation struct {
	*AuthenticatedOperation
	Repository *catalog.Repository
}

func (*RepoOperation) EncodeError

func (o *RepoOperation) EncodeError(err errors.APIError)

type RepoOperationHandler

type RepoOperationHandler interface {
	RequiredPermissions(request *http.Request, repository string) ([]permissions.Permission, error)
	Handle(op *RepoOperation)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL