Browse Source

Added comments to resolve outstanding issue caused by temporal proximity

to not having actually read this code for a few months.
master
Benjamin Shelton 2 weeks ago
parent
commit
5f4ccd3fa8
1 changed files with 16 additions and 2 deletions
  1. +16
    -2
      proxy.go

+ 16
- 2
proxy.go View File

@ -112,8 +112,16 @@ func (d *proxy) Switch(router chi.Router) {
// This is the multi-application proxy.
//
// This proxy integrates with an application loader, usually a radix loader, for
// mapping multiple applications to different endpoints.
// This proxy integrates with an application loader, usually a radix loader (but
// anything implementing the loader interface will work), for mapping multiple
// applications to different endpoints.
//
// Most stand alone Capstan applications will use the default proxy loader (see
// above). The proxy loader will be replaced when `AttachApplication()` is
// called.
//
// This loader implements the MultiAppProxyHandler interface as well such that
// it may support nested applications.
type multiAppProxy struct {
loader api.ApplicationLoader
}
@ -209,6 +217,12 @@ func NewRadixLoader(def http.Handler) *radixLoader {
}
}
// AddApplicationHandler attaches an http.Handler to a URL endpoint defined by
// `uri`.
//
// Note that the full request path isn't processed by the controller; path
// components intended to be processed here require sub-applications be
// configured with the appropriate BasePath.
func (r *radixLoader) AddApplicationHandler(uri string, handler http.Handler) error {
p, err := url.Parse("url://" + uri)
if err != nil {


Loading…
Cancel
Save