azsessions

package
v0.0.0-...-5c79d48 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

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 (c *Config) CheckAndSetDefaults() error

func (*Config) SetFromURL

func (c *Config) SetFromURL(u *url.URL) error

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 NewHandler

func NewHandler(ctx context.Context, cfg Config) (*Handler, error)

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

func (h *Handler) Download(ctx context.Context, sessionID session.ID, writerAt io.WriterAt) error

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

func (h *Handler) ListUploads(ctx context.Context) ([]events.StreamUpload, error)

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.

Jump to

Keyboard shortcuts

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