An open API service providing repository metadata for many open source software ecosystems.

Package Usage: go: github.com/openziti/xweb

Package xweb provides facilities to creating composable xweb.WebHandlers and http.Server's from configuration files. xweb provides customizable and extendable components to stand up multiple http.Server's listening on one or more network interfaces and ports. Each xweb.Xweb is responsible for defining configuration sections to be parsed, parsing the configuration, starting servers, and shutting down relevant server. An example implementation is included in the package: xweb.XwebImpl. This implementation should cover most use cases. In addition xweb.XwebImpl makes use of xweb.Config which is reusable component for parsing xweb.XwebImpl configuration sections. Both xweb.Xweb and xweb.Config assume that configuration will be acquired from some source and be presented as a map of interface{}-to-interface{} values. xweb.Config configuration sections allow the definition of an array of xweb.WebListener. In turn each xweb.WebListener can listen on many interface/port combinations specified by an array of xweb.BindPoint's and host many http.Handler's by defining an array of xweb.API's that are converted into xweb.WebHandler's. xweb.WebHandler's are http.Handler's with meta data and can be as complex or as simple as necessary - using other libraries or only the standard http Go capabilities. To deal with a single xweb.WebListener hosting multiple APIs as web.WebListener's, incoming requests must be forwarded to the correct xweb.WebHandler. The responsibility is handled by another configurable http.Handler called an "xweb demux handler". This handler's responsibility is to inspect incoming requests and forward them to the correct xweb.WebHandler. It is specified by an xweb.DemuxFactory and a reference implementation, xweb.PathPrefixDemuxFactory has been provided. Another way to say it: each Xweb defines a configuration section (default `web`) to define WebListener's and their hosted APIs. Each WebListener maps to one http.Server per BindPoint. No two WebListeners can have colliding BindPoint's due to port conflicts.
1 version
Latest release: almost 3 years ago
8 dependent packages

View more package details: https://packages.ecosyste.ms/registries/proxy.golang.org/packages/github.com/openziti/xweb

View more repository details: http://repos.ecosyste.ms/hosts/GitHub/repositories/openziti%2Fxweb

Dependent Repos 1

openziti/zitilab 📦
Ziti specific Fablab components for cloud deployment and testing

Size: 596 KB - Last synced: 11 months ago - Pushed: almost 2 years ago