codec

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MEDIA_JPEG = "jpeg"
	MEDIA_LINK = "link"
)

Variables

This section is empty.

Functions

func CropToScale

func CropToScale(source image.Point, target image.Point) (int, int)

CropToScale calculates a new dimension of image

Types

type Codec

type Codec struct {
	// contains filtered or unexported fields
}

func NewCodec

func NewCodec(profile medium.Profile, rfs ReaderFS, wfs WriterFS) *Codec

func (*Codec) Process

func (codec *Codec) Process(ctx context.Context, evt swarm.Msg[*events.S3EventRecord]) error
type Link struct {
	Url string `json:"url"`
}

type Media

type Media struct {
	// contains filtered or unexported fields
}

Container for digital media

type Meta added in v0.1.4

type Meta struct {
	ContentType string
}

type Reader

type Reader struct {
	http.Stack
	// contains filtered or unexported fields
}

func NewReader

func NewReader(stack http.Stack, fsys ReaderFS) *Reader

func (Reader) Get

func (r Reader) Get(ctx context.Context, evt swarm.Msg[*events.S3EventRecord]) (*Media, error)

type ReaderFS added in v0.1.4

type ReaderFS = fs.FS

Abstract media file reader.

type Scaler

type Scaler struct {
	// contains filtered or unexported fields
}

func NewScaler

func NewScaler(resolution medium.Resolution) *Scaler

func (Scaler) Process

func (s Scaler) Process(ctx context.Context, media *Media) (*Media, error)

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(fsys WriterFS) *Writer

func (Writer) Put

func (wrt Writer) Put(ctx context.Context, media *Media) (err error)

type WriterFS added in v0.1.4

type WriterFS = stream.CreateFS[Meta]

Abstract media file writer.

Jump to

Keyboard shortcuts

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