httpserver

package
v0.0.0-...-4aeb316 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package httpserver defines the HTTPServer type that listens to requests over HTTP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPServer

type HTTPServer struct {
	// contains filtered or unexported fields
}

HTTPServer defines an HTTP server that will offer an endpoint to execute a requester.

func New

func New(port string) (*HTTPServer, error)

New creates a new instance of an HTTP server.

func (*HTTPServer) Addr

func (srv *HTTPServer) Addr() string

Addr returns the server's listening address.

func (*HTTPServer) ServeRequester

func (srv *HTTPServer) ServeRequester(ctx context.Context, fn requester.Fn) error

ServeRequester starts the HTTP server and listens on the configured port for incoming requests. The provided function fn will be executed for each such requests.

Jump to

Keyboard shortcuts

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