server

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2017 License: Apache-2.0, Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DisableStartupInfo is a flag that indicates whether or not to print
	// startup info. This is sometimes disabled for CI systems to reduce logs.
	DisableStartupInfo, _ = strconv.ParseBool(os.Getenv(
		"LIBSTORAGE_DISABLE_STARTUP_INFO"))
)

Functions

func Close

func Close() <-chan error

Close closes all servers. This function can be used when a calling program traps UNIX signals or when it exits gracefully.

func CloseOnAbort

func CloseOnAbort()

CloseOnAbort is a helper function that can be called by programs, such as tests or a command line or service application.

func Serve

func Serve(
	goCtx gocontext.Context,
	config gofig.Config) (types.Server, <-chan error, error)

Serve starts serving the configured libStorage endpoints. This function returns a channel on which errors are received. Reading this channel is also the prescribed manner for clients wishing to block until the server is shutdown as the error channel will be closed when the server is stopped.

Types

type HTTPServer

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

HTTPServer contains an instance of http server and the listener.

srv *http.Server, contains configuration to create a http server and a mux router with all api end points.

l net.Listener, is a TCP or Socket listener that dispatches incoming request to the router.

func (*HTTPServer) Close

func (s *HTTPServer) Close() error

Close closes the HTTPServer from listening for the inbound requests.

func (*HTTPServer) Context

func (s *HTTPServer) Context() types.Context

Context returns this server's types.

func (*HTTPServer) Serve

func (s *HTTPServer) Serve() error

Serve starts listening for inbound requests.

Directories

Path Synopsis
router

Jump to

Keyboard shortcuts

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