service

package
v0.0.0-...-d09d7ef Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package service provides the asciist HTTP service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() http.Handler

New creates an instance of the asciist service.

func SetDebug

func SetDebug(debug bool)

SetDebug enables or disables the debug mode of the underlying HTTP framework. Call SetDebug before creating an instance of the service with New.

Types

type Failure

type Failure struct {
	Error string `json:"error"`
}

Failure is the shape of a failed ASCII art conversion response (indicated with an HTTP status ≥ 400 and an application/json Content-Type). Note that internal server errors or gateway errors may result in clients seeing non-JSON responses or JSON responses not matching this shape.

type Request

type Request struct {
	Width uint   `json:"width"`
	Image []byte `json:"image"`
}

Request is the shape of an ASCII art conversion request. (Note that encoding/json will automatically base64-encode Image).

type Success

type Success struct {
	Art string `json:"art"`
}

Success is the shape of a successful ASCII art conversion response (indicated with a 200 OK status).

Jump to

Keyboard shortcuts

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