restful

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API contains all references needed to convert a processing request

func NewAPI

func NewAPI(opts *APIOptions, readerFactory *readers.URLReaderFactory, converter abstractions.Converter) *API

NewAPI instantiates a new HTTP handler for converting images

func (*API) Start

func (api *API) Start() error

Start initiates a blocking HTTP listener

type APIOptions

type APIOptions struct {
	Port     int
	Endpoint string
}

APIOptions enables customization for how the HTTP server is started

func NewAPIOptions

func NewAPIOptions(endpoint string) *APIOptions

NewAPIOptions instantiates a new options container with default values

type ProcessingRequest

type ProcessingRequest struct {
	Source     *url.URL
	OutputSpec *abstractions.OutputSpec
}

ProcessingRequest contains all necessary information to process an image for resizing, cropping, etc

func NewProcessingRequest

func NewProcessingRequest(r *http.Request) (*ProcessingRequest, error)

NewProcessingRequest translates a GET request to a `processingRequest`

Jump to

Keyboard shortcuts

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