Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 7.9% on proxy.golang.org
Top 1.4% dependent packages on proxy.golang.org
Top 2.5% dependent repos on proxy.golang.org
Top 2.1% docker downloads on proxy.golang.org

proxy.golang.org : github.com/openziti/xweb/v2

Package xweb provides facilities to creating composable xweb.ApiHandler instances 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 Instance 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: InstanceImpl. This implementation should cover most use cases. In addition, InstanceImpl makes use of InstanceConfig which is reusable component for parsing InstanceImpl configuration sections. Both Instance and InstanceConfig assume that configuration will be acquired from some source and be presented as a map of interface{}-to-interface{} values. InstanceConfig configuration sections allow the definition of an array of ServerConfig. In turn each ServerConfig can listen on many interface/port combinations specified by an array of BindPointConfig's and host many http.Handler's by defining an array of ApiConfig's that are converted into ApiHandler's. ApiHandler's are http.Handler's with metadata 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 ServerConfig hosting multiple APIs as web.ServerConfig's, incoming requests must be forwarded to the correct ApiHandler. 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 ApiHandler. It is specified by an DemuxFactory and a reference implementation, PathPrefixDemuxFactory has been provided. Another way to say it: each Instance defines a configuration section (default `web`) to define ServerConfig's and their hosted APIs. Each ServerConfig maps to one Server/http.Server per BindPointConfig. No two Server instances can have colliding BindPointConfig's due to port conflicts.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/openziti/xweb/v2
Keywords: go, golang, http-server, webapi, webserver
License: Apache-2.0
Latest release: 11 months ago
First release: almost 2 years ago
Namespace: github.com/openziti/xweb
Dependent packages: 13
Dependent repositories: 4
Stars: 3 on GitHub
Forks: 0 on GitHub
Docker dependents: 9
Docker downloads: 5,103
See more repository details: repos.ecosyste.ms
Last synced: 23 days ago

    Loading...
    Readme
    Loading...