server

package
v0.0.0-...-a679065 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2015 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeConcatRequest

func DecodeConcatRequest(r *http.Request) (interface{}, error)

DecodeConcatRequest decodes the request from the provided HTTP request, simply by JSON decoding from the request body. It's designed to be used in transport/http.Server.

func DecodeConcatResponse

func DecodeConcatResponse(resp *http.Response) (interface{}, error)

DecodeConcatResponse decodes the response from the provided HTTP response, simply by JSON decoding from the response body. It's designed to be used in transport/http.Client.

func DecodeSumRequest

func DecodeSumRequest(r *http.Request) (interface{}, error)

DecodeSumRequest decodes the request from the provided HTTP request, simply by JSON decoding from the request body. It's designed to be used in transport/http.Server.

func DecodeSumResponse

func DecodeSumResponse(resp *http.Response) (interface{}, error)

DecodeSumResponse decodes the response from the provided HTTP response, simply by JSON decoding from the response body. It's designed to be used in transport/http.Client.

func EncodeConcatRequest

func EncodeConcatRequest(r *http.Request, request interface{}) error

EncodeConcatRequest encodes the request to the provided HTTP request, simply by JSON encoding to the request body. It's designed to be used in transport/http.Client.

func EncodeConcatResponse

func EncodeConcatResponse(w http.ResponseWriter, response interface{}) error

EncodeConcatResponse encodes the response to the provided HTTP response writer, simply by JSON encoding to the writer. It's designed to be used in transport/http.Server.

func EncodeSumRequest

func EncodeSumRequest(r *http.Request, request interface{}) error

EncodeSumRequest encodes the request to the provided HTTP request, simply by JSON encoding to the request body. It's designed to be used in transport/http.Client.

func EncodeSumResponse

func EncodeSumResponse(w http.ResponseWriter, response interface{}) error

EncodeSumResponse encodes the response to the provided HTTP response writer, simply by JSON encoding to the writer. It's designed to be used in transport/http.Server.

Types

type AddService

type AddService interface {
	Sum(a, b int) int
	Concat(a, b string) string
}

AddService is the abstract representation of this service.

type ConcatRequest

type ConcatRequest struct {
	A string `json:"a"`
	B string `json:"b"`
}

ConcatRequest is the business domain type for a Concat method request.

type ConcatResponse

type ConcatResponse struct {
	V string `json:"v"`
}

ConcatResponse is the business domain type for a Concat method response.

type SumRequest

type SumRequest struct {
	A int `json:"a"`
	B int `json:"b"`
}

SumRequest is the business domain type for a Sum method request.

type SumResponse

type SumResponse struct {
	V int `json:"v"`
}

SumResponse is the business domain type for a Sum method response.

Jump to

Keyboard shortcuts

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