greeter

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package greeter contains the HTTP server for greeter services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(
	greeter Greeter,
) *remotohttp.Server

New makes a new remotohttp.Server with the specified services registered.

func RegisterGreeterServer

func RegisterGreeterServer(server *remotohttp.Server, service Greeter)

RegisterGreeterServer registers a Greeter with a remotohttp.Server.

func Run

func Run(addr string,
	greeter Greeter,
) error

Run is the simplest way to run the services.

Types

type GreetRequest

type GreetRequest struct {
	Name string `json:"name"`
}

type GreetResponse

type GreetResponse struct {
	Greeting string `json:"greeting"`

	// Error is an error message if one occurred.
	Error string `json:"error"`
}

type Greeter

type Greeter interface {
	Greet(context.Context, *GreetRequest) (*GreetResponse, error)
}

Jump to

Keyboard shortcuts

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