http

package
v0.0.0-...-9c44629 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VersionHandler

func VersionHandler(writer http.ResponseWriter, _ *http.Request)

func WhitelistHeaders

func WhitelistHeaders() runtime.HeaderMatcherFunc

Types

type HandlerFunc

type HandlerFunc func(ctx context.Context, mux *runtime.ServeMux, address string, opts []grpc.DialOption) (err error)

type Option

type Option func(s *Server)

func WithAddress

func WithAddress(address string) Option

func WithDialOption

func WithDialOption(opts ...grpc.DialOption) Option

func WithGRPCAddress

func WithGRPCAddress(address string) Option

func WithHandlerFunc

func WithHandlerFunc(fs ...HandlerFunc) Option

func WithHttpHandlerFunc

func WithHttpHandlerFunc(path string, fs http.HandlerFunc) Option

type Server

type Server struct {
	Mux *runtime.ServeMux

	Server           *http.Server
	GRPCAddress      string
	Address          string
	DialOptions      []grpc.DialOption
	HandlerFuncs     []HandlerFunc
	HTTPHandlerFuncs map[string]http.HandlerFunc
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Server

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

func (*Server) Stop

func (s *Server) Stop(ctx context.Context)

Jump to

Keyboard shortcuts

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