Documentation ¶
Index ¶
- Constants
- func HttpHandler(w http.ResponseWriter, r *http.Request)
- func Milliseconds(duration time.Duration) int
- func RegisterHandler(path string, handler HttpHandlerFunc) error
- func SetAuthHandler(h func(w http.ResponseWriter, r *http.Request), ok func(int) bool)
- func SetHostTimeout(d time.Duration)
- func Startup(duration time.Duration, content ContentMap) bool
- func UprootUrn(uri string) (nid, nss string, ok bool)
- type ContentMap
- type HttpHandlerFunc
- func NewAccessLogIntermediary(routeName string, c2 HttpHandlerFunc) HttpHandlerFunc
- func NewConditionalIntermediary(c1 HttpHandlerFunc, c2 HttpHandlerFunc, ok func(int) bool) HttpHandlerFunc
- func NewHostTimeoutIntermediary(d time.Duration, c2 HttpHandlerFunc) HttpHandlerFunc
- func NewIngressTimeoutIntermediary(routeName string, d time.Duration, c2 HttpHandlerFunc) HttpHandlerFunc
- type Proxy
Constants ¶
View Source
const ( Authorization = "Authorization" TimeoutFlag = "TO" XRequestId = "X-Request-Id" )
View Source
const ( UrnScheme = "urn" UrnSeparator = ":" )
View Source
const (
PkgPath = "github/advanced-go/core/host"
)
View Source
const (
RouteName = "host"
)
Variables ¶
This section is empty.
Functions ¶
func HttpHandler ¶
func HttpHandler(w http.ResponseWriter, r *http.Request)
HttpHandler - handler for messaging
func Milliseconds ¶
Milliseconds - convert time.Duration to milliseconds
func RegisterHandler ¶
func RegisterHandler(path string, handler HttpHandlerFunc) error
RegisterHandler - add a path and Http handler to the proxy TO DO : panic on duplicate handler and pattern combination
func SetAuthHandler ¶
func SetHostTimeout ¶
Types ¶
type ContentMap ¶
ContentMap - slice of any content to be included in a message
type HttpHandlerFunc ¶
type HttpHandlerFunc func(w http.ResponseWriter, r *http.Request)
func NewAccessLogIntermediary ¶
func NewAccessLogIntermediary(routeName string, c2 HttpHandlerFunc) HttpHandlerFunc
func NewConditionalIntermediary ¶
func NewConditionalIntermediary(c1 HttpHandlerFunc, c2 HttpHandlerFunc, ok func(int) bool) HttpHandlerFunc
func NewHostTimeoutIntermediary ¶
func NewHostTimeoutIntermediary(d time.Duration, c2 HttpHandlerFunc) HttpHandlerFunc
func NewIngressTimeoutIntermediary ¶
func NewIngressTimeoutIntermediary(routeName string, d time.Duration, c2 HttpHandlerFunc) HttpHandlerFunc
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy - key value pairs of a URI -> HttpHandler
func (*Proxy) LookupByNID ¶
LookupByNID - get an HttpHandler from the proxy, using an NID as a key
Click to show internal directories.
Click to hide internal directories.