rotate

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Overview

package rotate provides common methods for rotating image files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RotateRequest

type RotateRequest struct {
	// A valid Who's On First ID (to remove).
	Id int64 `json:"id"`
	// The number of degrees to rotate a media file.
	Degrees int `json:"degrees"`
	// The data repository where Id is stored.
	Repo string `json:"repo"`
	// A boolean flag indicating whether to remove the old file on completion.
	Prune bool `json:"prune"`
}

type RotateRequest provides a struct encapsulating data for rotating a given media file.

type RotateResponse

type RotateResponse struct {
	// The Who's On First ID of the media file that was rotated.
	Id int64
	// The URI secret associated with the rotated media file.
	Secret string
	// The URI label associated with the rotated media file.
	Label string
	// The filename extension associated with the rotated media file.
	Extension string
	// An image.Image instance containing the body of the rotated media file.
	Image image.Image
	// The URI of the unrotated media file.
	OldPath string
	// The URI of the rotated media file.
	NewPath string
}

type RotateResponse provides a struct containing metadata about a rotated media file.

type Rotation

type Rotation struct {
	// DataSource is a valid gocloud.dev/blob Bucket URI where WOF feature records associated with media files are stored.
	DataSource string
	// MediaSource is a valid gocloud.dev/blob Bucket URI where media files are stored.
	MediaSource string
	// A valid whosonfirst/go-whosonfirst-export Exporter for exporting Who's On First feature records.
	Exporter export.Exporter
	// A boolean flag indicating whether to perform a removal in "dry run" mode.
	Dryrun bool
}

type Rotation provides a struct for rotating media files.

func NewRotation

func NewRotation(ex export.Exporter) (*Rotation, error)

NewRotation returns a new Rotation instance.

func (*Rotation) Rotate

func (r *Rotation) Rotate(ctx context.Context, requests ...*RotateRequest) error

Rotate will rotate one or more media files defined in 'requests'.

Jump to

Keyboard shortcuts

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