Created
February 18, 2020 00:15
-
-
Save FCO/b5ff6f7470ecc127fb988c2dbe00a4ef to your computer and use it in GitHub Desktop.
EEL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
event login { | |
has $session-id = #post.req-id; | |
has $timestamp = #post.timestamp; | |
match { | |
request(#get , method == "GET" , path == "/login", status == 200) | |
request(#post, method == "POST", path == "/login", status == 200, req-id == #get.req-id) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
raku -I. -MEEL -e ' | |
my Supplier $supplier .= new; | |
eel($supplier.Supply, :code("examples/login")).tap: *.say; | |
$supplier.emit: %( :type<request>, :method<GET> , :path</>, :req-id<aaaa1111>, :status(200) ); | |
$supplier.emit: %( :type<request>, :method<GET> , :path</>, :req-id<aaaa2222>, :status(200) ); | |
$supplier.emit: %( :type<request>, :method<GET> , :path</login>, :req-id<1234abcd>, :status(200) ); | |
$supplier.emit: %( :type<request>, :method<GET> , :path</>, :req-id<aaaa3333>, :status(200) ); | |
$supplier.emit: %( :type<request>, :method<GET> , :path</login>, :req-id<4321xyzz>, :status(200) ); | |
$supplier.emit: %( :type<request>, :method<POST>, :path</login>, :req-id<1234abcd>, :status(200), :session-id<abc123> ); | |
' | |
{session-id => abc123, timestamp => Instant:1581984202.052599, type => login} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment