types

package
v0.13.7 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 3 Imported by: 32

Documentation

Index

Constants

View Source
const Crop = "crop"

Crop indicates we should crop the thumbnail on resize

View Source
const Scale = "scale"

Scale indicates we should scale the thumbnail on resize

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveRemoteRequests

type ActiveRemoteRequests struct {
	sync.Mutex
	// The string key is an mxc:// URL
	MXCToResult map[string]*RemoteRequestResult
}

ActiveRemoteRequests is a lockable map of media URIs requested from remote homeservers It is used for ensuring multiple requests for the same file do not clobber each other.

type ActiveThumbnailGeneration

type ActiveThumbnailGeneration struct {
	sync.Mutex
	// The string key is a thumbnail file path
	PathToResult map[string]*ThumbnailGenerationResult
}

ActiveThumbnailGeneration is a lockable map of file paths being thumbnailed It is used to ensure thumbnails are only generated once.

type Base64Hash

type Base64Hash string

Base64Hash is a base64 URLEncoding string representation of a SHA-256 hash sum

type ContentType

type ContentType string

ContentType is an HTTP Content-Type header string representing the MIME type of a request body

type FileSizeBytes

type FileSizeBytes int64

FileSizeBytes is a file size in bytes

type Filename

type Filename string

Filename is a string representing the name of a file

type MatrixUserID

type MatrixUserID string

MatrixUserID is a Matrix user ID string in the form @user:domain e.g. @alice:matrix.org

type MediaID

type MediaID string

MediaID is a string representing the unique identifier for a file (could be a hash but does not have to be)

type MediaMetadata

type MediaMetadata struct {
	MediaID           MediaID
	Origin            spec.ServerName
	ContentType       ContentType
	FileSizeBytes     FileSizeBytes
	CreationTimestamp spec.Timestamp
	UploadName        Filename
	Base64Hash        Base64Hash
	UserID            MatrixUserID
}

MediaMetadata is metadata associated with a media file

type Path

type Path string

Path is an absolute or relative UNIX filesystem path

type RemoteRequestResult

type RemoteRequestResult struct {
	// Condition used for the requester to signal the result to all other routines waiting on this condition
	Cond *sync.Cond
	// MediaMetadata of the requested file to avoid querying the database for every waiting routine
	MediaMetadata *MediaMetadata
	// An error, nil in case of no error.
	Error error
}

RemoteRequestResult is used for broadcasting the result of a request for a remote file to routines waiting on the condition

type RequestMethod

type RequestMethod string

RequestMethod is an HTTP request method i.e. GET, POST, etc

type ThumbnailGenerationResult

type ThumbnailGenerationResult struct {
	// Condition used for the generator to signal the result to all other routines waiting on this condition
	Cond *sync.Cond
	// Resulting error from the generation attempt
	Err error
}

ThumbnailGenerationResult is used for broadcasting the result of thumbnail generation to routines waiting on the condition

type ThumbnailMetadata

type ThumbnailMetadata struct {
	MediaMetadata *MediaMetadata
	ThumbnailSize ThumbnailSize
}

ThumbnailMetadata contains the metadata about an individual thumbnail

type ThumbnailSize

type ThumbnailSize config.ThumbnailSize

ThumbnailSize contains a single thumbnail size configuration

Jump to

Keyboard shortcuts

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