Documentation
¶
Overview ¶
Package imageserver provides an Image server toolkit.
Index ¶
- Constants
- func ImageEqual(im1, im2 *Image) bool
- type Handler
- type HandlerFunc
- type HandlerServer
- type Image
- type ImageError
- type ParamError
- type Params
- func (params Params) Empty() bool
- func (params Params) Get(key string) (interface{}, error)
- func (params Params) GetBool(key string) (bool, error)
- func (params Params) GetFloat(key string) (float64, error)
- func (params Params) GetInt(key string) (int, error)
- func (params Params) GetParams(key string) (Params, error)
- func (params Params) GetString(key string) (string, error)
- func (params Params) Has(key string) bool
- func (params Params) Keys() []string
- func (params Params) Len() int
- func (params Params) Set(key string, value interface{})
- func (params Params) String() string
- type Server
- type ServerFunc
- type SourceServer
Constants ¶
const ( // ImageFormatMaxLen is the maximum length for the image's format. ImageFormatMaxLen = 1 << 8 // 256 B // ImageDataMaxLen is the maximum length for the image's data. ImageDataMaxLen = 1 << 30 // 1 GiB )
const SourceParam = "source"
SourceParam is the source Param name.
Variables ¶
This section is empty.
Functions ¶
func ImageEqual ¶
ImageEqual compares two images and returns true if they are equal.
Types ¶
type HandlerFunc ¶
HandlerFunc is a Handler func.
type HandlerServer ¶
HandlerServer is a Handler Server.
type Image ¶
Image is a raw image.
Binary encoding:
- Format length (uint32)
- Format (string)
- Data length (uint32)
- Data([]byte)
Numbers are encoded using little-endian order.
func (*Image) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler.
func (*Image) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler.
It copies data then call UnmarshalBinaryNoCopy().
func (*Image) UnmarshalBinaryNoCopy ¶
UnmarshalBinaryNoCopy is like encoding.BinaryUnmarshaler but does no copy.
The caller must not reuse data after that.
type ImageError ¶
type ImageError struct {
Message string
}
ImageError is an Image error.
func (*ImageError) Error ¶
func (err *ImageError) Error() string
type ParamError ¶
ParamError is an error for a param.
func (*ParamError) Error ¶
func (err *ParamError) Error() string
type Params ¶
type Params map[string]interface{}
Params are params used in Image Server.
This is a wrapper around map[string]interface{} and provides utility methods. It should only contains basic Go types values (string, int float64, ...) or nested Params.
Getter methods return a *ParamError if the key does not exist or the type does not match.
type Server ¶
Server serves an Image.
func NewLimitServer ¶
NewLimitServer creates a new Server that limits the number of concurrent executions.
It uses a buffered channel to limit the number of concurrent executions.
type ServerFunc ¶
ServerFunc is a Server func.
type SourceServer ¶
type SourceServer struct {
Server
}
SourceServer is a source Server.
It forwards to the underlying Server with only the source param.
Directories
¶
Path | Synopsis |
---|---|
Package cache provides an Image cache.
|
Package cache provides an Image cache. |
_test
Package _test provides utilities for Cache testing.
|
Package _test provides utilities for Cache testing. |
groupcache
Package groupcache provides a groupcache Image Server.
|
Package groupcache provides a groupcache Image Server. |
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. |
examples
|
|
advanced
Package advanced provides an advanced example.
|
Package advanced provides an advanced example. |
simple
Package simple provides a simple example.
|
Package simple provides a simple example. |
Package graphicsmagick provides a GraphicsMagick Image Server.
|
Package graphicsmagick provides a GraphicsMagick Image Server. |
Package http provides a HTTP Handler for an Image Server.
|
Package http provides a HTTP Handler for an Image Server. |
gamma
Package gamma provides a imageserver/http.Parser implementation for imageserver/image/gamma.CorrectionProcessor.
|
Package gamma provides a imageserver/http.Parser implementation for imageserver/image/gamma.CorrectionProcessor. |
gift
Package gift provides a GIFT HTTP Parser
|
Package gift provides a GIFT HTTP Parser |
graphicsmagick
Package graphicsmagick provides a GraphicsMagick HTTP Parser.
|
Package graphicsmagick provides a GraphicsMagick HTTP Parser. |
image
Package image provides imageserver/http.Parser implementations for imageserver/image.
|
Package image provides imageserver/http.Parser implementations for imageserver/image. |
nfntresize
Package nfntresize provides a nfnt resize HTTP Parser.
|
Package nfntresize provides a nfnt resize HTTP Parser. |
Package httpsource provides a HTTP source Image Server.
|
Package httpsource provides a HTTP source Image Server. |
Package image provides a bridge to the Go image package.
|
Package image provides a bridge to the Go image package. |
_test
Package _test provides utilities for Encoder testing.
|
Package _test provides utilities for Encoder testing. |
bmp
Package bmp provides a BMP Encoder.
|
Package bmp provides a BMP Encoder. |
gamma
Package gamma provides gamma Processor and CorrectionProcessor.
|
Package gamma provides gamma Processor and CorrectionProcessor. |
gif
Package gif provides a GIF Encoder, Handler, and Processor.
|
Package gif provides a GIF Encoder, Handler, and Processor. |
gift
Package gift provides a GIFT Processor.
|
Package gift provides a GIFT Processor. |
jpeg
Package jpeg provides a JPEG Encoder.
|
Package jpeg provides a JPEG Encoder. |
nfntresize
Package nfntresize provides a nfnt resize Processor.
|
Package nfntresize provides a nfnt resize Processor. |
png
Package png provides a PNG Encoder.
|
Package png provides a PNG Encoder. |
tiff
Package tiff provides a TIFF Encoder.
|
Package tiff provides a TIFF Encoder. |