Documentation ¶
Overview ¶
Package interceptor exports a interfaces that defines a interceptor.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interceptor ¶
type Interceptor interface { // Rules returns a list of interceptor.InterceptorRuler with the functions that it will validate // if the content must be modify or not. Rules() []InterceptorRuler // Handler returns a [interceptor.InterceptorHandler] with all operations to modify a content requested. Handler() InterceptorHandler }
Interceptor exposes two methods to handle the modification that must be apply to the content requested.
type InterceptorHandler ¶
InterceptorHandler defines a function that execution the injection.
Receives an *http.Response with the request content to modify.
type InterceptorRuler ¶
InterceptorRuler defines a function that contains the rules to determine if a request must be injected or not.
Receives an *http.Response with the requested content to be evaluated by the rule. Returns true if a request pass the rule, otherwise must be return false.
Directories ¶
Path | Synopsis |
---|---|
Package liverreload injects in a html page requested a snippet from a filepath to handle a livereload system in client side.
|
Package liverreload injects in a html page requested a snippet from a filepath to handle a livereload system in client side. |
Click to show internal directories.
Click to hide internal directories.