Documentation ¶
Index ¶
- func ConvertS3Error(err error, args ...interface{}) error
- type Config
- type Handler
- func (h *Handler) Close() error
- func (h *Handler) CompleteUpload(ctx context.Context, upload events.StreamUpload, parts []events.StreamPart) error
- func (h *Handler) CreateUpload(ctx context.Context, sessionID session.ID) (*events.StreamUpload, error)
- func (h *Handler) Download(ctx context.Context, sessionID session.ID, writer io.WriterAt) error
- func (h *Handler) GetUploadMetadata(sessionID session.ID) events.UploadMetadata
- func (h *Handler) ListParts(ctx context.Context, upload events.StreamUpload) ([]events.StreamPart, error)
- func (h *Handler) ListUploads(ctx context.Context) ([]events.StreamUpload, error)
- func (h *Handler) ReserveUploadPart(ctx context.Context, upload events.StreamUpload, partNumber int64) error
- func (h *Handler) Upload(ctx context.Context, sessionID session.ID, reader io.Reader) (string, error)
- func (h *Handler) UploadPart(ctx context.Context, upload events.StreamUpload, partNumber int64, ...) (*events.StreamPart, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertS3Error ¶
ConvertS3Error wraps S3 error and returns trace equivalent
Types ¶
type Config ¶
type Config struct { // Bucket is S3 bucket name Bucket string // Region is S3 bucket region Region string // Path is an optional bucket path Path string // Endpoint is an optional third party S3 compatible endpoint Endpoint string // ACL is the canned ACL to send to S3 ACL string // Session is an optional existing AWS client session Session *awssession.Session // Credentials if supplied are used in tests Credentials *credentials.Credentials // SSEKMSKey specifies the optional custom CMK used for KMS SSE. SSEKMSKey string // UseFIPSEndpoint uses AWS FedRAMP/FIPS 140-2 mode endpoints. // to determine its behavior: // Unset - allows environment variables or AWS config to set the value // Enabled - explicitly enabled // Disabled - explicitly disabled UseFIPSEndpoint types.ClusterAuditConfigSpecV2_FIPSEndpointState // Insecure is an optional switch to opt out of https connections Insecure bool //DisableServerSideEncryption is an optional switch to opt out of SSE in case the provider does not support it DisableServerSideEncryption bool }
Config is handler configuration
func (*Config) CheckAndSetDefaults ¶
CheckAndSetDefaults checks and sets defaults
type Handler ¶
type Handler struct { // Config is handler configuration Config // Entry is a logging entry *log.Entry // contains filtered or unexported fields }
Handler handles upload and downloads to S3 object storage
func NewHandler ¶
NewHandler returns new S3 uploader
func (*Handler) CompleteUpload ¶
func (h *Handler) CompleteUpload(ctx context.Context, upload events.StreamUpload, parts []events.StreamPart) error
CompleteUpload completes the upload
func (*Handler) CreateUpload ¶
func (h *Handler) CreateUpload(ctx context.Context, sessionID session.ID) (*events.StreamUpload, error)
CreateUpload creates a multipart upload
func (*Handler) Download ¶
Download downloads recorded session from S3 bucket and writes the results into writer return trace.NotFound error is object is not found.
func (*Handler) GetUploadMetadata ¶
func (h *Handler) GetUploadMetadata(sessionID session.ID) events.UploadMetadata
GetUploadMetadata gets the metadata for session upload
func (*Handler) ListParts ¶
func (h *Handler) ListParts(ctx context.Context, upload events.StreamUpload) ([]events.StreamPart, error)
ListParts lists upload parts
func (*Handler) ListUploads ¶
ListUploads lists uploads that have been initiated but not completed
func (*Handler) ReserveUploadPart ¶
func (h *Handler) ReserveUploadPart(ctx context.Context, upload events.StreamUpload, partNumber int64) error
ReserveUploadPart reserves an upload part.
func (*Handler) Upload ¶
func (h *Handler) Upload(ctx context.Context, sessionID session.ID, reader io.Reader) (string, error)
Upload uploads object to S3 bucket, reads the contents of the object from reader and returns the target S3 bucket path in case of successful upload.
func (*Handler) UploadPart ¶
func (h *Handler) UploadPart(ctx context.Context, upload events.StreamUpload, partNumber int64, partBody io.ReadSeeker) (*events.StreamPart, error)
UploadPart uploads part