Documentation ¶
Index ¶
- type Config
- type Handler
- 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, writerAt 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 (*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 ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // ServiceURL is the URL for the storage account to use. ServiceURL url.URL // SessionContainerName is the name of the container that stores finalized // session recordings. Defaults to [defaultSessionContainerName]. SessionContainerName string // InprogressContainerName is the name of the container that stores // in-progress data that's yet to be finalized in a recording. Defaults to // [defaultInprogressContainerName]. InprogressContainerName string // Log is the logger to use. If unset, it will default to the global logger // with a component of "azblob". Log logrus.FieldLogger }
Config is a struct of parameters to define the behavior of Handler.
func (*Config) CheckAndSetDefaults ¶
func (*Config) SetFromURL ¶
SetFromURL sets values in Config based on the passed in URL: the fragment of the URL is parsed as if it was made out of query parameters, which define options for ourselves, and then the remainder of the URL is set as the service URL.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a MultipartHandler that stores data in Azure Blob Storage.
func (*Handler) CompleteUpload ¶
func (h *Handler) CompleteUpload(ctx context.Context, upload events.StreamUpload, parts []events.StreamPart) error
CompleteUpload implements events.MultipartUploader by composing the final session recording blob in the session container from the parts in the inprogress container, using the Put Block From URL API. Might take a little time, but doesn't require any data transfer.
func (*Handler) CreateUpload ¶
func (h *Handler) CreateUpload(ctx context.Context, sessionID session.ID) (*events.StreamUpload, error)
CreateUpload implements events.MultipartUploader.
func (*Handler) Download ¶
Download implements events.UploadHandler.
func (*Handler) GetUploadMetadata ¶
func (h *Handler) GetUploadMetadata(sessionID session.ID) events.UploadMetadata
GetUploadMetadata implements events.MultipartUploader.
func (*Handler) ListParts ¶
func (h *Handler) ListParts(ctx context.Context, upload events.StreamUpload) ([]events.StreamPart, error)
ListParts implements events.MultipartUploader.
func (*Handler) ListUploads ¶
ListUploads implements events.MultipartUploader.
func (*Handler) ReserveUploadPart ¶
func (*Handler) ReserveUploadPart(ctx context.Context, upload events.StreamUpload, partNumber int64) error
ReserveUploadPart implements events.MultipartUploader.
func (*Handler) Upload ¶
func (h *Handler) Upload(ctx context.Context, sessionID session.ID, reader io.Reader) (string, error)
Upload implements events.UploadHandler.
func (*Handler) UploadPart ¶
func (h *Handler) UploadPart(ctx context.Context, upload events.StreamUpload, partNumber int64, partBody io.ReadSeeker) (*events.StreamPart, error)
UploadPart implements events.MultipartUploader.