iFun Engine API  1.0.0-b6053
Great Technology for Great Games
Classes | Public Types | Static Public Member Functions | List of all members
fun::ApiService Class Reference
Inheritance diagram for fun::ApiService:

Classes

struct  JwtVerifier
 

Public Types

typedef boost::function< void(const Ptr< http::Response > &)> ResponseWriter ASSERT_NO_ROLLBACK
 Functor to send a http response and finish a http request processing.
 
typedef boost::function< void(Ptr< http::Response > ret, const http::Request &request, const MatchResult &params)> Handler
 
typedef boost::function< void(Ptr< http::Response > ret, const http::Request2 &request, const MatchResult &params)> Handler2
 
typedef boost::function< void(const http::Request2 &request, const MatchResult &params, const ResponseWriter &finisher)> Handler3
 
typedef boost::function< void(const fun::Json &jwt_claim, const http::Request2 &request, const MatchResult &params, const ResponseWriter &finisher)> JwtEnabledHandler
 
typedef boost::smatch MatchResult
 

Static Public Member Functions

static void RegisterHandler (const http::Method &method, const boost::regex &re, const Handler &handler)
 Register API handler for the given path regular expression. More...
 
static void RegisterHandler2 (const http::Method &method, const boost::regex &re, const Handler2 &handler)
 Register API handler for the given path regular expression. More...
 
static void RegisterHandler3 (const http::Method &method, const boost::regex &re, const Handler3 &handler)
 Register API handler for the given path regular expression. More...
 
static void RegisterJwtEnabledHandler (const http::Method &method, const boost::regex &re, const JwtEnabledHandler &handler, const Ptr< JwtVerifier > &jwt_verifier)
 

Member Typedef Documentation

◆ Handler

typedef boost::function< void(Ptr<http::Response> ret, const http::Request &request, const MatchResult &params)> fun::ApiService::Handler
Parameters
retpointer to http::Response.
requesthttp::Request instance.
paramsmap that holds named params in the path.

◆ Handler2

typedef boost::function< void(Ptr<http::Response> ret, const http::Request2 &request, const MatchResult &params)> fun::ApiService::Handler2
Parameters
retpointer to http::Response.
requesthttp::Request2 instance for multiple query string values.
paramsmap that holds named params in the path.

◆ Handler3

typedef boost::function< void(const http::Request2 &request, const MatchResult &params, const ResponseWriter &finisher)> fun::ApiService::Handler3
Parameters
retpointer to http::Response.
requesthttp::Request2 instance for multiple query string values.
paramsmap that holds named params in the path.
finisherfunctor to finish the http request.

Member Function Documentation

◆ RegisterHandler()

static void fun::ApiService::RegisterHandler ( const http::Method method,
const boost::regex &  re,
const Handler handler 
)
static

You can use (?<NAME>pattern) to name a subexpression and the tagged expression will be passed as ParamMap (i.e. key=NAME and value=matching result)

Parameters
methodeither kGet, kPost, kDelete, ...
restring Perl-style regular expression.
handlerHandler instance.

◆ RegisterHandler2()

static void fun::ApiService::RegisterHandler2 ( const http::Method method,
const boost::regex &  re,
const Handler2 handler 
)
static

You can use (?<NAME>pattern) to name a subexpression and the tagged expression will be passed as ParamMap (i.e. key=NAME and value=matching result)

Parameters
methodeither kGet, kPost, kDelete, ...
restring Perl-style regular expression.
handlerHandler2 instance.

◆ RegisterHandler3()

static void fun::ApiService::RegisterHandler3 ( const http::Method method,
const boost::regex &  re,
const Handler3 handler 
)
static

You can use (?<NAME>pattern) to name a subexpression and the tagged expression will be passed as ParamMap (i.e. key=NAME and value=matching result)

Parameters
methodeither kGet, kPost, kDelete, ...
restring Perl-style regular expression.
handlerHandler3 instance.