ExStorageServiceCli.XmlParser (ex_storage_service_cli v0.1.0)

Copy Markdown View Source

Lightweight S3 XML response parser using :xmerl.

Parses standard S3 XML responses into Elixir maps.

Summary

Functions

Parses an S3 Error XML response.

Parses a ListAllMyBucketsResult XML response.

Parses a ListBucketResult (V2) XML response.

Functions

parse_error(xml)

Parses an S3 Error XML response.

Returns {:ok, %{code: String, message: String}} or :error.

parse_list_buckets(xml)

Parses a ListAllMyBucketsResult XML response.

Returns a list of bucket maps with :name and :creation_date keys.

parse_list_objects(xml)

Parses a ListBucketResult (V2) XML response.

Returns a map with:

  • :contents - list of object maps
  • :common_prefixes - list of prefix strings
  • :is_truncated - boolean
  • :next_continuation_token - string or nil
  • :key_count - integer