Documentation ¶
Overview ¶
Package imageserver provides an image server
Index ¶
- func ImageEqual(image1, image2 *Image) bool
- type Error
- type Image
- type ImageServer
- type ImageServerFunc
- type ImageServerInterface
- type Parameters
- func (parameters Parameters) Empty() bool
- func (parameters Parameters) Get(key string) (interface{}, error)
- func (parameters Parameters) GetBool(key string) (bool, error)
- func (parameters Parameters) GetInt(key string) (int, error)
- func (parameters Parameters) GetParameters(key string) (Parameters, error)
- func (parameters Parameters) GetString(key string) (string, error)
- func (parameters Parameters) Has(key string) bool
- func (parameters Parameters) Keys() []string
- func (parameters Parameters) Len() int
- func (parameters Parameters) Set(key string, value interface{})
- func (parameters Parameters) String() string
- type Processor
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImageEqual ¶
ImageEqual compares two images and returns true if they are equal
Types ¶
type Error ¶
type Error struct {
Text string
}
Error represents an error displayable to the end user.
It is used in the http server: the errors of this type are displayed, the others are shown as "internal error".
type Image ¶
Image represents a raw image
func NewImageUnmarshalBinary ¶
NewImageUnmarshalBinary creates a new Image from serialized bytes
func (*Image) MarshalBinary ¶
MarshalBinary serializes the Image to bytes
It's very unlikely that it returns an error (impossible?)
func (*Image) UnmarshalBinary ¶
UnmarshalBinary unserializes bytes to the Image
type ImageServer ¶
ImageServer represents an Image server
func (*ImageServer) Get ¶
func (imageServer *ImageServer) Get(parameters Parameters) (*Image, error)
Get returns an Image for given Parameters
The "source" parameter is required.
type ImageServerFunc ¶
type ImageServerFunc func(parameters Parameters) (*Image, error)
ImageServerFunc is a ImageServer func
func (ImageServerFunc) Get ¶
func (f ImageServerFunc) Get(parameters Parameters) (*Image, error)
Get calls the func
type ImageServerInterface ¶
type ImageServerInterface interface {
Get(Parameters) (*Image, error)
}
ImageServerInterface represents an interface for an Image server
type Parameters ¶
type Parameters map[string]interface{}
Parameters represents parameters used in imageserver package
This is a wrapper around map and provides getter and hash methods ¶
Getter methods return an error if the key does not exist or the type does not match
func (Parameters) Empty ¶
func (parameters Parameters) Empty() bool
Empty returns true if parameters is empty and false otherwise
func (Parameters) Get ¶
func (parameters Parameters) Get(key string) (interface{}, error)
Get returns the value for the key
It returns an error if the value is not found
func (Parameters) GetBool ¶
func (parameters Parameters) GetBool(key string) (bool, error)
GetBool returns the value as a bool for the key
It returns an error if the value is not a bool
func (Parameters) GetInt ¶
func (parameters Parameters) GetInt(key string) (int, error)
GetInt returns the value as an int for the key
It returns an error if the value is not an int
func (Parameters) GetParameters ¶
func (parameters Parameters) GetParameters(key string) (Parameters, error)
GetParameters returns the value as a Parameters for the key
It returns an error if the value is not a Parameters
func (Parameters) GetString ¶
func (parameters Parameters) GetString(key string) (string, error)
GetString returns the value as a string for the key
It returns an error if the value is not a string
func (Parameters) Has ¶
func (parameters Parameters) Has(key string) bool
Has returns true if the key exists and false otherwise
func (Parameters) Set ¶
func (parameters Parameters) Set(key string, value interface{})
Set sets the value for the key
func (Parameters) String ¶
func (parameters Parameters) String() string
String returns the string representation
Keys are sorted alphabetically
type Processor ¶
type Processor interface {
Process(*Image, Parameters) (*Image, error)
}
Processor represents an Image processor
type Provider ¶
type Provider interface {
Get(source interface{}, parameters Parameters) (*Image, error)
}
Provider represents an Image provider
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
_examples
|
|
_test
Package _test provides utilities for cache testing
|
Package _test provides utilities for cache testing |
async
Package async provides an asynchronous cache
|
Package async provides an asynchronous cache |
list
Package list provides a list of Image Cache
|
Package list provides a list of Image Cache |
memcache
Package memcache provides a Memcache Image Cache
|
Package memcache provides a Memcache Image Cache |
memory
Package memory provides an in-memory Image Cache
|
Package memory provides an in-memory Image Cache |
redis
Package redis provides a Redis Image Cache
|
Package redis provides a Redis Image Cache |
Package http provides an HTTP Handler for the imageserver package
|
Package http provides an HTTP Handler for the imageserver package |
parser/graphicsmagick
Package graphicsmagick provides a GraphicsMagick http Parser
|
Package graphicsmagick provides a GraphicsMagick http Parser |
parser/list
Package list provides a list of http Parser
|
Package list provides a list of http Parser |
parser/source
Package source provides an http Parser that takes the "source" parameter from query
|
Package source provides an http Parser that takes the "source" parameter from query |
parser/sourcepath
Package sourcepath provides an http Parser that takes the "source" parameter from the path
|
Package sourcepath provides an http Parser that takes the "source" parameter from the path |
processor
|
|
graphicsmagick
Package graphicsmagick provides a GraphicsMagick Image Processor
|
Package graphicsmagick provides a GraphicsMagick Image Processor |
limit
Package limit provides an Image Processor that limits the number of concurrent executions
|
Package limit provides an Image Processor that limits the number of concurrent executions |
list
Package list provides a list of Image Processor
|
Package list provides a list of Image Processor |
provider
|
|
cache
Package cache provides a cached Image Provider
|
Package cache provides a cached Image Provider |
http
Package http provides a http Image Provider
|
Package http provides a http Image Provider |