Documentation
¶
Overview ¶
Package server provides http server setup and handler to serve image generation requests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnsupportedFormat = fiber.NewError(fiber.ErrBadRequest.Code, "unsupported image format") ErrInvalidParamSize = fiber.NewError(fiber.ErrBadRequest.Code, "invalid size ("+keySize+") value") ErrInvalidParamScale = fiber.NewError(fiber.ErrBadRequest.Code, "invalid scale ("+keyScale+") value") ErrInvalidParamBgColor = fiber.NewError(fiber.ErrBadRequest.Code, "invalid background color ("+keyBgColor+") value") ErrInvalidParamTextColor = fiber.NewError(fiber.ErrBadRequest.Code, "invalid text color ("+keyTextColor+") value") )
Client Errors
View Source
var SupportedFormats = []string{ img.IMAGE_JPG, img.IMAGE_JPEG, img.IMAGE_PNG, img.IMAGE_TIFF, img.IMAGE_WEBP, }
Supported image formats
Functions ¶
func HandlerImage ¶
HandlerImage is a handler to serve image generation request.
It is only compatible with fiber.Handler inteface and not with [http.Handler] interface.
func SetupAndListen ¶
func SetupAndListen()
SetupAndListen fires up a http server to handle incoming requests for image generation.
For supported image formats, see SupportedFormats.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.