Help us shape the future of Go! Take the 2026 Go Developer Survey

exportform

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package exportform decodes the New export form from a request or a query, for the media item page and the redirect a finished preview comes back through.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromQuery

func FromQuery(
	ctx fiber.Ctx,
	defaultCrop, defaultPreserve bool,
	title string,
) view.ExportForm

FromQuery reads the export form state off the request.

Parameters:

  • ctx: Incoming page request.
  • defaultCrop: Configured crop-black-bars default.
  • defaultPreserve: Configured keep-HDR default.
  • title: Media title, used when the request carries no clip name.

Returns:

  • form: The export form state to render.

func FromRequest

func FromRequest(req api.ClipRequest) view.ExportForm

FromRequest captures the export form fields of a parsed request.

Parameters:

  • req: The parsed form or JSON request.

Returns:

  • form: The export form state to carry across the redirect.

func MediaItemForm

func MediaItemForm(ctx fiber.Ctx, cfg *config.Config, title string) view.ExportForm

MediaItemForm builds the New export form state for the media item page.

Parameters:

  • ctx: Incoming page request.
  • cfg: Configuration supplying the form defaults.
  • title: Resolved media title, used when the query carries no clip name.

Returns:

  • form: The export form state to render.

func NormalizeType

func NormalizeType(raw string) clip.Type

NormalizeType maps a query value onto an export type the form offers.

Parameters:

  • raw: Query value for the export type.

Returns:

  • kind: A supported export type, or the default when raw is not offered.

Types

type Window

type Window struct {
	// Start is where the clip begins in the source.
	Start time.Duration
	// End is where the clip ends in the source.
	End time.Duration
}

Window is the New export form's start and end marks.

func ClipWindow

func ClipWindow(ctx fiber.Ctx) Window

ClipWindow reads the start and end marks of the New export form.

Parameters:

  • ctx: Incoming page request.

Returns:

  • window: The marks, with end guaranteed to be ahead of start.

Jump to

Keyboard shortcuts

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