README
¶
encoder
import "github.com/wyattjoh/ims/internal/image/encoder"
Overview
Index
Package files
type Encoder
type Encoder interface {
Encode(m image.Image, w http.ResponseWriter) error
}
Encoder describes any type that can encode with the image and response writer.
func Get
func Get(format string, r *http.Request) Encoder
Get parses the format
query variable and uses it to see if the user has
specified the output format, otherwise, it tries to see if it can
encode the image with the source format, otherwise, it just encodes it as
"jpeg".
type WrapEncoderFunc
type WrapEncoderFunc func(m image.Image, w http.ResponseWriter) error
WrapEncoderFunc type is an adapter to allow the use of ordinary functions as image Encoders. If f is a function with the appropriate signature, WrapEncoderFunc(f) is a Encoder that calls f.
func (WrapEncoderFunc) Encode
func (f WrapEncoderFunc) Encode(m image.Image, w http.ResponseWriter) error
Encode calls f(m, w).
Generated by godoc2md
Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encoder ¶
type Encoder interface {
Encode(m image.Image, w http.ResponseWriter) error
}
Encoder describes any type that can encode with the image and response writer.
type WrapEncoderFunc ¶
type WrapEncoderFunc func(m image.Image, w http.ResponseWriter) error
WrapEncoderFunc type is an adapter to allow the use of ordinary functions as image Encoders. If f is a function with the appropriate signature, WrapEncoderFunc(f) is a Encoder that calls f.
func (WrapEncoderFunc) Encode ¶
func (f WrapEncoderFunc) Encode(m image.Image, w http.ResponseWriter) error
Encode calls f(m, w).