server

package
v0.0.0-...-96111de Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package server provides a helper implementation to help handling multiple services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(opts ...Option) error

Serve is the single entry to start serving servers.

Types

type Endpoint

type Endpoint struct {
	Method          string
	Path            string
	Endpoint        endpoint.Endpoint
	RequestDecoder  httptransport.DecodeRequestFunc
	ResponseEncoder httptransport.EncodeResponseFunc
}

Endpoint presents an endpoint.

type Option

type Option func(n *helperServer)

Option presents an option to enhance server.

func WithCORS

func WithCORS(opts cors.Options) Option

WithCORS adds CORS support.

func WithHTTPAddress

func WithHTTPAddress(addr string) Option

WithHTTPAddress sets the address for HTTP service to listen on.

func WithHTTPEndpoint

func WithHTTPEndpoint(e Endpoint) Option

WithHTTPEndpoint ...

Jump to

Keyboard shortcuts

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