media

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InvalidMediaUrlError = errors.New("invalid media url")

Functions

This section is empty.

Types

type Downloader

type Downloader interface {
	DownloadMedia(ctx context.Context, origin string, mediaId string) ([]byte, error)
}

type Item added in v1.1.0

type Item struct {
	Origin  string
	MediaId string
	// contains filtered or unexported fields
}

Item - A piece of media that was extracted from an event.

func NewItem added in v1.1.0

func NewItem(mediaUrl string, downloader Downloader) (*Item, error)

NewItem - Creates a new Item instance from the given URL. Returns an InvalidMediaUrlError if the URL is invalid or not an MXC URL.

func (*Item) Download added in v1.1.0

func (m *Item) Download() ([]byte, error)

func (*Item) String added in v1.1.0

func (m *Item) String() string

Jump to

Keyboard shortcuts

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