CustomDirectives
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
CustomDirectives.type
Members list
Value members
Concrete methods
Generate an access log using spectator HttpLogEntry utility.
Generate an access log using spectator HttpLogEntry utility.
Value parameters
- headers
-
Additional headers to apply to the response before passing to the logger. This is intended for providing additional context such as the server group and zone of the particular server instance with common IPC.
Attributes
Add connection close header to some responses. This can be useful when using network load balancers to allow some connection reuse, but force connections to close frequently enough to ensure that traffic balances across instances.
Add connection close header to some responses. This can be useful when using network load balancers to allow some connection reuse, but force connections to close frequently enough to ensure that traffic balances across instances.
Value parameters
- probability
-
A value of 0.0 means it will never be added, 1.0 means it will always be added.
Attributes
Wraps a route with support for CORS. This will handle the preflight checks as well as adding the appropriate headers to the response of the inner route.
Wraps a route with support for CORS. This will handle the preflight checks as well as adding the appropriate headers to the response of the inner route.
Attributes
Route for CORS handling pre-flight checks.
Route for CORS handling pre-flight checks.
Attributes
Used with parseEntity
to decode the request entity to an object of type T
using a custom decoder function. If the content type is application/x-jackson-smile
, then a smile parser will be used. Otherwise it will be treated as application/json
regardless of the content type.
Used with parseEntity
to decode the request entity to an object of type T
using a custom decoder function. If the content type is application/x-jackson-smile
, then a smile parser will be used. Otherwise it will be treated as application/json
regardless of the content type.
Attributes
Alternative to the built-in path
directive that will set the Netflix-Endpoint
header based on the currently matched path. To avoid matching paths with arbitrary values that should not be a part of the header, the path matcher is restricted so that values cannot be extracted. Use endpointPathPrefix
with a nested path
directive for those use-cases.
Alternative to the built-in path
directive that will set the Netflix-Endpoint
header based on the currently matched path. To avoid matching paths with arbitrary values that should not be a part of the header, the path matcher is restricted so that values cannot be extracted. Use endpointPathPrefix
with a nested path
directive for those use-cases.
Attributes
This is a convenience directive for the common pattern of have a fixed path with an extracted portion such as an identifier at the end. It will set the endpoint header based on the prefix matcher. Example:
This is a convenience directive for the common pattern of have a fixed path with an extracted portion such as an identifier at the end. It will set the endpoint header based on the prefix matcher. Example:
endpointPathPrefix("api" / "v1" / "instances") {
path(Remaining) { id =>
...
}
}
Can instead be written as:
endpointPath("api" / "v1" / "instances", Remaining) { id =>
...
}
Attributes
Alternative to the built-in pathPrefix
directive that will set the Netflix-Endpoint
header based on the currently matched path. To avoid matching paths with arbitrary values that should not be a part of the header, the path matcher is restricted so that values cannot be extracted.
Alternative to the built-in pathPrefix
directive that will set the Netflix-Endpoint
header based on the currently matched path. To avoid matching paths with arbitrary values that should not be a part of the header, the path matcher is restricted so that values cannot be extracted.
Attributes
Used with parseEntity
to decode the request entity to an object of type T
using the default ObjectMapper from atlas-json
. If the content type is application/x-jackson-smile
, then a smile parser will be used. Otherwise it will be treated as application/json
regardless of the content type.
Used with parseEntity
to decode the request entity to an object of type T
using the default ObjectMapper from atlas-json
. If the content type is application/x-jackson-smile
, then a smile parser will be used. Otherwise it will be treated as application/json
regardless of the content type.
Note: This is kept as a separate function passed into the parseEntity
directive because adding the manifest to T
causes problems when used directly on the directive. It also makes it possible to reuse parseEntity
with a custom function.
Attributes
Used with entity
to decode the request entity to an object of type T
using the default ObjectMapper from atlas-json
. If the content type is application/x-jackson-smile
, then a smile parser will be used. Otherwise it will be treated as application/json
regardless of the content type.
Used with entity
to decode the request entity to an object of type T
using the default ObjectMapper from atlas-json
. If the content type is application/x-jackson-smile
, then a smile parser will be used. Otherwise it will be treated as application/json
regardless of the content type.
Attributes
Returns a JSONP response. This directive will always try to return a 200 response so that the javascript code in the browser can better deal with errors. The actual response status code and headers will be included as part of the JSON object returned.
Returns a JSONP response. This directive will always try to return a 200 response so that the javascript code in the browser can better deal with errors. The actual response status code and headers will be included as part of the JSON object returned.
Attributes
Parses the request entity into an object of type T
. The parsing is done by passing in the complete request data to the function f
.
Parses the request entity into an object of type T
. The parsing is done by passing in the complete request data to the function f
.
Attributes
Filter to provide basic CORS support. By default it assumes that actual security is provided elsewhere. The goal for this filter is to allow javascript UIs or other tools to access the APIs and work with minimal fuss.
Filter to provide basic CORS support. By default it assumes that actual security is provided elsewhere. The goal for this filter is to allow javascript UIs or other tools to access the APIs and work with minimal fuss.
The hosts param specifies a whitelist for allowing cross-origin requests. Default is no requests will get CORS headers.
Attributes
Adds the Netflix-Endpoint
header to the response if it is not already present. This directive is typically not used directly, it is preferred to use one of the endpointPath*
directives instead.
Adds the Netflix-Endpoint
header to the response if it is not already present. This directive is typically not used directly, it is preferred to use one of the endpointPath*
directives instead.