server

package
v0.0.0-...-fe10e82 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EncodingDefaults = map[string]encodingDefault{
	"jpeg": {

		DesiredQuality: 85,
		// contains filtered or unexported fields
	},
	"jpg": {

		DesiredQuality: 85,
		// contains filtered or unexported fields
	},
	"png": {

		DesiredQuality: 3,
		// contains filtered or unexported fields
	},
}

EncodingDefaults are used to easily define the default values for a given encoding

View Source
var FunctionMappings = map[string]CVFunction{
	"resize": ResizeMatrix,
}

FunctionMappings maps an incoming id to the desired function

Functions

func EncodeMatrix

func EncodeMatrix(mat gocv.Mat, format, quality string) ([]byte, error)

EncodeMatrix .

func ResizeMatrix

func ResizeMatrix(mat gocv.Mat, parameters map[string]string) (*gocv.Mat, error)

ResizeMatrix placeholder

Types

type AwsConfig

type AwsConfig struct {
	S3Downloader   *s3manager.Downloader
	Cache          *cache.ImageCache
	CacheNamespace uuid.UUID
}

AwsConfig configuration

func NewAwsConfig

func NewAwsConfig(mc *cache.ImageCache) (*AwsConfig, error)

NewAwsConfig returns a new AWS configuration

func (*AwsConfig) GetObject

func (a *AwsConfig) GetObject(bucket, key string) ([]byte, error)

GetObject returns an s3 object

type CVFunction

type CVFunction func(mat gocv.Mat, parameters map[string]string) (*gocv.Mat, error)

CVFunction .

type ComplexHandlerJSON

type ComplexHandlerJSON struct {
	Encoding  string `json:"encoding"`
	Quality   int    `json:"quality"`
	Functions []struct {
		FunctionID string                     `json:"functionID"`
		Parameters []complexHandlerParameters `json:"parameters"`
	} `json:"functions"`
}

ComplexHandlerJSON used to unmarshal

type Handler

type Handler struct {
	AwsConfig *AwsConfig
}

Handler for routes

func NewHandler

func NewHandler(aws *AwsConfig) *Handler

NewHandler returns an initialised handler

func (*Handler) Complex

Complex handler takes json objects as input and 'curries' the matrix through the desired functions outlined in the json object

func (*Handler) Simple

Simple .

Jump to

Keyboard shortcuts

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