server

package
v0.0.0-...-de70330 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 10 Imported by: 0

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

Supported image formats

Functions

func HandlerImage

func HandlerImage(ctx *fiber.Ctx) error

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.

Jump to

Keyboard shortcuts

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