Quantcast
Channel: Akka Libraries - Discussion Forum for Akka technologies
Viewing all articles
Browse latest Browse all 1362

Custom Directive that returns case class?

$
0
0

Forgive the noob question. I currently have a Directive set up like:

def combinedDirective: Directive[(String, RemoteAddress)] =
    headerValueByName("blah") & extractClientIP

Is it possible to create a case class that takes a RemoteAddress (for clientIp) and String (for headerValue) and populate that from other directives to be used within a route?

Something like:

def combinedDirective:
Directive[DirectiveCaseClass] = 
DirectiveCaseClass(headerValueByName("blah",  extractClientIP)

I’ve played around with a few of the built in api for Directive but couldn’t quite get anything working. Is what I’m trying to do possible?

Many Thanks!

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 1362

Trending Articles