Packages
aws
0.10.1
1.0.14
1.0.13
1.0.12
1.0.11
1.0.10
1.0.9
1.0.8
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
0.14.1
0.14.0
0.13.3
0.13.2
0.13.1
0.13.0
0.12.0
0.11.0
0.10.1
0.10.0
0.9.2
0.9.1
0.9.0
0.8.0
0.7.0
0.6.0
0.5.0
0.4.0
0.3.0
0.2.0
0.1.0
0.0.12
0.0.11
0.0.10
0.0.9
0.0.8
0.0.7
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
AWS clients for Elixir
Current section
Files
Jump to
Current section
Files
lib/aws/util.ex
defmodule AWS.Util do
@moduledoc false
@doc """
Encodes URI preserving segments.
Segments are separated by a slash - "/".
"""
def encode_multi_segment_uri(uri) do
uri
|> String.split("/")
|> Enum.map_join("/", &encode_uri/1)
end
@doc """
Encodes URI keeping unreserved chars untouched.
"""
def encode_uri(uri) do
URI.encode(uri, &URI.char_unreserved?/1)
end
@doc """
Encode map into querystring.
"""
def encode_query(value) do
value
|> Enum.map(fn {k, v} -> {k, to_string(v)} end)
|> :uri_string.compose_query()
end
end