encodings

package
v2.2.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2020 License: MIT Imports: 4 Imported by: 0

README

goa v2 Encodings Example

This simple example demonstrates HTTP responses with the 'text/html' content type encoding. It consists of a simple endpoint that concatenates strings.

Design

Objects cannot be encoded with 'text/html', so the design illustrates several ways to specify a text response that will be compatible with the encoding. For example, a response type String:

Result(String)

HTTP(func() {
    // The payload fields are encoded as path parameters.
    GET("/concatstrings/{a}/{b}")
    Response(StatusOK, func() {
        // Respond with text/html
        ContentType("text/html")
    })
})

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewText

func NewText(logger *log.Logger) text.Service

NewText returns the text service implementation.

Types

This section is empty.

Directories

Path Synopsis
cmd
gen

Jump to

Keyboard shortcuts

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