Seastar
High performance C++ framework for concurrent servers
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Public Member Functions | List of all members
seastar::httpd::match_rule Class Reference

Detailed Description

match_rule check if a url matches criteria, that can contains parameters. the routes object would call the get method with a url and if it matches, the method will return a handler during the matching process, the method fill the parameters object.

#include <seastar/http/matchrules.hh>

Public Member Functions

 ~match_rule ()
 
 match_rule (handler_base *handler)
 
handler_baseget (const sstring &url, parameters &params)
 
match_ruleadd_matcher (matcher *match)
 
match_ruleadd_str (const sstring &str)
 
match_ruleadd_param (const sstring &str, bool fullpath=false)
 

Constructor & Destructor Documentation

◆ ~match_rule()

seastar::httpd::match_rule::~match_rule ( )
inline

The destructor deletes matchers.

◆ match_rule()

seastar::httpd::match_rule::match_rule ( handler_base handler)
inlineexplicit

Constructor with a handler

Parameters
handlerthe handler to return when this match rule is met

Member Function Documentation

◆ add_matcher()

match_rule & seastar::httpd::match_rule::add_matcher ( matcher match)
inline

Add a matcher to the rule

Parameters
matchthe matcher to add
Returns
this

◆ add_param()

match_rule & seastar::httpd::match_rule::add_param ( const sstring &  str,
bool  fullpath = false 
)
inline

add a parameter matcher to the rule

Parameters
strthe parameter name
fullpathwhen set to true, parameter will included all the remaining url until its end
Returns
this

◆ add_str()

match_rule & seastar::httpd::match_rule::add_str ( const sstring &  str)
inline

Add a static url matcher

Parameters
strthe string to search for
Returns
this

◆ get()

handler_base * seastar::httpd::match_rule::get ( const sstring &  url,
parameters params 
)
inline

Check if url match the rule and return a handler if it does

Parameters
urla url to compare against the rule
paramsthe parameters object, matches parameters will fill the object during the matching process
Returns
a handler if there is a full match or nullptr if not

The documentation for this class was generated from the following file: