server

package
v0.0.0-...-0821f6f Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package server allows rpc/server implementations to be deployed to AWS Lambda.

This package has a default *rpc.Server. Services may be registered with the Register and RegisterName functions, as with the net/rpc package. The package's *rpc.Server may also be set with the RPCServer function.

Invocations are handled via the builtin server's ServeRequest method. No assumptions may be made about the server's lifecycle or state beyond the assumption a method will be invoked at least once per container lifetime so it is possible to do certain types of initialization once. Likewise init functions and package-scoped variables may be used with care and consideration.

The Lambda environment receives a payload of an *rpc.Request and the request body. The response is an *rpc.Response and the response body.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RPCServer

func RPCServer(s *rpc.Server)

RPCServer sets this package's default server to s.

func Register

func Register(i interface{}) error

Register registers i with this package's default server.

func RegisterName

func RegisterName(name string, i interface{}) error

RegisterName registers i with name with this package's default server.

func Serve

func Serve()

Serve begins serving this package's default server as set with RPCServer or configured with the Register functions. In a non-Lambda environment, starts a net/rpc server on a random port.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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