Current section

5 Versions

Jump to

Compare versions

46 files changed
+876 additions
-734 deletions
  @@ -8,18 +8,13 @@ gleam add typed_headers
8 8 ```
9 9 ```gleam
10 10 import gleam/list
11 - import typed_headers
11 + import typed_headers/header
12 12 import typed_headers/content_type
13 + import typed_headers/content_type/application
13 14
14 15 pub fn main() {
15 16 let headers =
16 - [
17 - typed_headers.ContentTypeHeader(
18 - content_type.ApplicationContentType(
19 - content_type.JSONApplicationContentType,
20 - )
21 - )
22 - ]
17 + [header.ContentType(content_type.Application(application.JSON))]
23 18 |> list.map(typed_headers.to_string)
24 19 }
25 20 ```
  @@ -1,5 +1,5 @@
1 1 name = "typed_headers"
2 - version = "1.0.1"
2 + version = "1.1.0"
3 3
4 4 description = "Types for HTTP headers"
5 5 licences = ["AGPL-3.0-only"]
  @@ -1,6 +1,6 @@
1 1 {<<"name">>, <<"typed_headers">>}.
2 2 {<<"app">>, <<"typed_headers">>}.
3 - {<<"version">>, <<"1.0.1">>}.
3 + {<<"version">>, <<"1.1.0">>}.
4 4 {<<"description">>, <<"Types for HTTP headers">>}.
5 5 {<<"licenses">>, [<<"AGPL-3.0-only">>]}.
6 6 {<<"build_tools">>, [<<"gleam">>]}.
  @@ -17,15 +17,37 @@
17 17 {<<"files">>, [
18 18 <<"README.md">>,
19 19 <<"gleam.toml">>,
20 - <<"include/content_type_CustomContentType.hrl">>,
21 - <<"include/content_type_OGGWithCodecsApplicationContentType.hrl">>,
22 - <<"include/content_type_WEBMWithCodecsAudioContentType.hrl">>,
23 - <<"include/typed_headers_CustomHeader.hrl">>,
24 - <<"src/content_type.erl">>,
25 - <<"src/content_type.gleam">>,
26 - <<"src/method.erl">>,
27 - <<"src/method.gleam">>,
20 + <<"include/typed_headers@content_type@application_OGGWithCodecs.hrl">>,
21 + <<"include/typed_headers@content_type@audio_WEBMWithCodecs.hrl">>,
22 + <<"include/typed_headers@content_type_CustomContentType.hrl">>,
23 + <<"include/typed_headers@header_Custom.hrl">>,
28 24 <<"src/typed_headers.app.src">>,
29 - <<"src/typed_headers.erl">>,
30 - <<"src/typed_headers.gleam">>
25 + <<"src/typed_headers/content_type.gleam">>,
26 + <<"src/typed_headers/content_type/application.gleam">>,
27 + <<"src/typed_headers/content_type/audio.gleam">>,
28 + <<"src/typed_headers/content_type/example.gleam">>,
29 + <<"src/typed_headers/content_type/font.gleam">>,
30 + <<"src/typed_headers/content_type/image.gleam">>,
31 + <<"src/typed_headers/content_type/message.gleam">>,
32 + <<"src/typed_headers/content_type/model.gleam">>,
33 + <<"src/typed_headers/content_type/multipart.gleam">>,
34 + <<"src/typed_headers/content_type/text.gleam">>,
35 + <<"src/typed_headers/content_type/video.gleam">>,
36 + <<"src/typed_headers/header.gleam">>,
37 + <<"src/typed_headers/method.gleam">>,
38 + <<"src/typed_headers/utils.gleam">>,
39 + <<"src/typed_headers@content_type.erl">>,
40 + <<"src/typed_headers@content_type@application.erl">>,
41 + <<"src/typed_headers@content_type@audio.erl">>,
42 + <<"src/typed_headers@content_type@example.erl">>,
43 + <<"src/typed_headers@content_type@font.erl">>,
44 + <<"src/typed_headers@content_type@image.erl">>,
45 + <<"src/typed_headers@content_type@message.erl">>,
46 + <<"src/typed_headers@content_type@model.erl">>,
47 + <<"src/typed_headers@content_type@multipart.erl">>,
48 + <<"src/typed_headers@content_type@text.erl">>,
49 + <<"src/typed_headers@content_type@video.erl">>,
50 + <<"src/typed_headers@header.erl">>,
51 + <<"src/typed_headers@method.erl">>,
52 + <<"src/typed_headers@utils.erl">>
31 53 ]}.
  @@ -1 +0,0 @@
1 - -record(custom_content_type, {media_type :: binary(), sub_type :: binary()}).
  @@ -1 +0,0 @@
1 - -record(ogg_with_codecs_application_content_type, {codecs :: list(binary())}).
Loading more files…