| summaryrefslogtreecommitdiff | 
diff options
| author | nsensfel <SpamShield0@noot-noot.org> | 2019-01-24 09:30:04 +0100 | 
|---|---|---|
| committer | nsensfel <SpamShield0@noot-noot.org> | 2019-01-24 09:30:04 +0100 | 
| commit | 04212005d8f4e078548738256add0f6c12138946 (patch) | |
| tree | 4a55d752d33e1d99a4134778c0e6da0dc28456b3 /src | |
| parent | 41f0db023cb6c1a609762b9679b3677143b3840f (diff) | |
Woops, forgot that file.
Diffstat (limited to 'src')
| -rw-r--r-- | src/shared/struct/shr_query.erl | 55 | 
1 files changed, 55 insertions, 0 deletions
| diff --git a/src/shared/struct/shr_query.erl b/src/shared/struct/shr_query.erl new file mode 100644 index 0000000..44d3222 --- /dev/null +++ b/src/shared/struct/shr_query.erl @@ -0,0 +1,55 @@ +-module(shr_query). + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +-include("../../../include/yaws_api.hrl"). + +-record +( +   query, +   { +      ip :: binary(), +      params :: map:map(binary(), any()) +   } +). + +-opaque type() :: #query{}. + +-export_type([type/0]). + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% EXPORTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +-export +( +   [ +      new/1, +      get_ip/1, +      get_params/1 +   ] +). + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% LOCAL FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% EXPORTED FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +-spec new (#arg{}) -> type(). +new (YawsArg) -> +   {IP, _} = YawsArg#arg.client_ip_port, + +   #query +   { +      ip = IP, +      params = jiffy:decode(YawsArg#arg.clidata, [return_maps]) +   }. + +-spec get_ip (type()) -> binary(). +get_ip (Query) -> Query#query.ip. + +-spec get_params (type()) -> map:map(binary(), any()). +get_params (Query) -> Query#query.params. | 


