Packages
mist
4.0.2
6.0.3
6.0.2
6.0.1
6.0.0
5.0.4
5.0.3
5.0.2
5.0.1
5.0.0
5.0.0-rc1
4.0.7
4.0.6
4.0.5
4.0.4
4.0.3
4.0.2
4.0.1
4.0.0
3.0.0
2.0.0
1.2.0
1.1.0
1.0.0
1.0.0-rc3
1.0.0-rc2
1.0.0-rc1
0.17.0
0.15.0
0.14.3
0.14.2
0.14.1
0.14.0
0.13.2
0.13.1
0.13.0
0.12.0
0.11.0
0.10.0
0.9.4
0.9.3
0.9.2
0.9.1
0.9.0
0.8.3
0.8.2
0.8.1
0.8.0
0.7.1
0.7.0
0.6.1
0.6.0
0.5.2
0.5.1
0.5.0
0.4.5
0.4.4
0.4.3
0.4.2
0.4.1
0.4.0
0.3.3
0.3.2
0.3.1
0.3.0
0.2.1
0.2.0
0.1.3
a misty Gleam web server
Current section
67 Versions
Jump to
Current section
67 Versions
Compare versions
21
files changed
+399
additions
-239
deletions
| @@ -11,7 +11,7 @@ dependencies as follows: | |
| 11 11 | ```sh |
| 12 12 | $ gleam new <your_project> |
| 13 13 | $ cd <your_project> |
| 14 | - $ gleam add mist gleam_erlang gleam_http gleam_otp |
| 14 | + $ gleam add mist gleam_erlang gleam_http gleam_otp gleam_yielder |
| 15 15 | ``` |
| 16 16 | |
| 17 17 | The main entrypoints for your application are `mist.start_http` and |
| @@ -21,16 +21,16 @@ fed updated configuration options with the associated methods (demonstrated | |
| 21 21 | in the examples below). |
| 22 22 | |
| 23 23 | ```gleam |
| 24 | - import gleam/bytes_builder |
| 24 | + import gleam/bytes_tree |
| 25 25 | import gleam/erlang/process |
| 26 26 | import gleam/http/request.{type Request} |
| 27 27 | import gleam/http/response.{type Response} |
| 28 28 | import gleam/io |
| 29 | - import gleam/iterator |
| 30 29 | import gleam/option.{None, Some} |
| 31 30 | import gleam/otp/actor |
| 32 31 | import gleam/result |
| 33 32 | import gleam/string |
| 33 | + import gleam/yielder |
| 34 34 | import mist.{type Connection, type ResponseData} |
| 35 35 | |
| 36 36 | pub fn main() { |
| @@ -40,7 +40,7 @@ pub fn main() { | |
| 40 40 | |
| 41 41 | let not_found = |
| 42 42 | response.new(404) |
| 43 | - |> response.set_body(mist.Bytes(bytes_builder.new())) |
| 43 | + |> response.set_body(mist.Bytes(bytes_tree.new())) |
| 44 44 | |
| 45 45 | let assert Ok(_) = |
| 46 46 | fn(req: Request(Connection)) -> Response(ResponseData) { |
| @@ -97,20 +97,20 @@ fn echo_body(request: Request(Connection)) -> Response(ResponseData) { | |
| 97 97 | mist.read_body(request, 1024 * 1024 * 10) |
| 98 98 | |> result.map(fn(req) { |
| 99 99 | response.new(200) |
| 100 | - |> response.set_body(mist.Bytes(bytes_builder.from_bit_array(req.body))) |
| 100 | + |> response.set_body(mist.Bytes(bytes_tree.from_bit_array(req.body))) |
| 101 101 | |> response.set_header("content-type", content_type) |
| 102 102 | }) |
| 103 103 | |> result.lazy_unwrap(fn() { |
| 104 104 | response.new(400) |
| 105 | - |> response.set_body(mist.Bytes(bytes_builder.new())) |
| 105 | + |> response.set_body(mist.Bytes(bytes_tree.new())) |
| 106 106 | }) |
| 107 107 | } |
| 108 108 | |
| 109 109 | fn serve_chunk(_request: Request(Connection)) -> Response(ResponseData) { |
| 110 110 | let iter = |
| 111 111 | ["one", "two", "three"] |
| 112 | - |> iterator.from_list |
| 113 | - |> iterator.map(bytes_builder.from_string) |
| 112 | + |> yielder.from_list |
| 113 | + |> yielder.map(bytes_tree.from_string) |
| 114 114 | |
| 115 115 | response.new(200) |
| 116 116 | |> response.set_body(mist.Chunked(iter)) |
| @@ -133,14 +133,14 @@ fn serve_file( | |
| 133 133 | }) |
| 134 134 | |> result.lazy_unwrap(fn() { |
| 135 135 | response.new(404) |
| 136 | - |> response.set_body(mist.Bytes(bytes_builder.new())) |
| 136 | + |> response.set_body(mist.Bytes(bytes_tree.new())) |
| 137 137 | }) |
| 138 138 | } |
| 139 139 | |
| 140 140 | fn handle_form(req: Request(Connection)) -> Response(ResponseData) { |
| 141 141 | let _req = mist.read_body(req, 1024 * 1024 * 30) |
| 142 142 | response.new(200) |
| 143 | - |> response.set_body(mist.Bytes(bytes_builder.new())) |
| 143 | + |> response.set_body(mist.Bytes(bytes_tree.new())) |
| 144 144 | } |
| 145 145 | |
| 146 146 | fn guess_content_type(_path: String) -> String { |
| @@ -164,7 +164,7 @@ gives you back a function to start reading chunks. This function will return: | |
| 164 164 | |
| 165 165 | ```gleam |
| 166 166 | pub type Chunk { |
| 167 | - Chunk(data: BitString, consume: fn(Int) -> Chunk) |
| 167 | + Chunk(data: BitArray, consume: fn(Int) -> Chunk) |
| 168 168 | Done |
| 169 169 | } |
| 170 170 | ``` |
| @@ -182,7 +182,7 @@ fn handle_form(req: Request(Connection)) -> Response(ResponseData) { | |
| 182 182 | // NOTE: This is a little misleading, since `Iterator`s can be replayed. |
| 183 183 | // However, this will only be running this once. |
| 184 184 | let content = |
| 185 | - iterator.unfold( |
| 185 | + yielder.unfold( |
| 186 186 | consume, |
| 187 187 | fn(consume) { |
| 188 188 | // Reads up to 1024 bytes from the request |
| @@ -190,13 +190,13 @@ fn handle_form(req: Request(Connection)) -> Response(ResponseData) { | |
| 190 190 | case res { |
| 191 191 | // The error will not be bubbled up to the iterator here. If either |
| 192 192 | // we've read all the body, or we see an error, the iterator finishes |
| 193 | - Ok(mist.Done) | Error(_) -> iterator.Done |
| 193 | + Ok(mist.Done) | Error(_) -> yielder.Done |
| 194 194 | // We read some data. It may be less than the specific amount above if |
| 195 195 | // we have consumed all of the body. You'll still need to call it |
| 196 196 | // again to ensure, since with `chunked` encoding, we need to check |
| 197 197 | // for the last chunk. |
| 198 198 | Ok(mist.Chunk(data, consume)) -> { |
| 199 | - iterator.Next(bit_builder.from_bit_string(data), consume) |
| 199 | + yielder.Next(bytes_tree.from_bit_array(data), consume) |
| 200 200 | } |
| 201 201 | } |
| 202 202 | }, |
| @@ -1,5 +1,5 @@ | |
| 1 1 | name = "mist" |
| 2 | - version = "4.0.1" |
| 2 | + version = "4.0.2" |
| 3 3 | |
| 4 4 | licences = ["Apache-2.0"] |
| 5 5 | description = "a misty Gleam web server" |
| @@ -11,7 +11,6 @@ gleam = ">= 1.4.0" | |
| 11 11 | application_start_module = "mist@internal@clock" |
| 12 12 | |
| 13 13 | [dependencies] |
| 14 | - birl = "~> 1.3" |
| 15 14 | gleam_erlang = "~> 0.24" |
| 16 15 | gleam_http = "~> 3.5" |
| 17 16 | gleam_otp = "~> 0.9" |
| @@ -1,6 +1,6 @@ | |
| 1 1 | {<<"name">>, <<"mist">>}. |
| 2 2 | {<<"app">>, <<"mist">>}. |
| 3 | - {<<"version">>, <<"4.0.1">>}. |
| 3 | + {<<"version">>, <<"4.0.2">>}. |
| 4 4 | {<<"description">>, <<"a misty Gleam web server"/utf8>>}. |
| 5 5 | {<<"licenses">>, [<<"Apache-2.0">>]}. |
| 6 6 | {<<"build_tools">>, [<<"gleam">>]}. |
| @@ -8,11 +8,31 @@ | |
| 8 8 | {<<"Repository">>, <<"https://github.com/rawhat/mist">>} |
| 9 9 | ]}. |
| 10 10 | {<<"requirements">>, [ |
| 11 | + {<<"gleam_otp">>, [ |
| 12 | + {<<"app">>, <<"gleam_otp">>}, |
| 13 | + {<<"optional">>, false}, |
| 14 | + {<<"requirement">>, <<"~> 0.9">>} |
| 15 | + ]}, |
| 16 | + {<<"hpack_erl">>, [ |
| 17 | + {<<"app">>, <<"hpack_erl">>}, |
| 18 | + {<<"optional">>, false}, |
| 19 | + {<<"requirement">>, <<"~> 0.3">>} |
| 20 | + ]}, |
| 21 | + {<<"gleam_stdlib">>, [ |
| 22 | + {<<"app">>, <<"gleam_stdlib">>}, |
| 23 | + {<<"optional">>, false}, |
| 24 | + {<<"requirement">>, <<">= 0.44.0 and < 1.0.0">>} |
| 25 | + ]}, |
| 11 26 | {<<"gleam_erlang">>, [ |
| 12 27 | {<<"app">>, <<"gleam_erlang">>}, |
| 13 28 | {<<"optional">>, false}, |
| 14 29 | {<<"requirement">>, <<"~> 0.24">>} |
| 15 30 | ]}, |
| 31 | + {<<"gramps">>, [ |
| 32 | + {<<"app">>, <<"gramps">>}, |
| 33 | + {<<"optional">>, false}, |
| 34 | + {<<"requirement">>, <<">= 3.0.0 and < 4.0.0">>} |
| 35 | + ]}, |
| 16 36 | {<<"logging">>, [ |
| 17 37 | {<<"app">>, <<"logging">>}, |
| 18 38 | {<<"optional">>, false}, |
| @@ -23,40 +43,15 @@ | |
| 23 43 | {<<"optional">>, false}, |
| 24 44 | {<<"requirement">>, <<">= 1.1.0 and < 2.0.0">>} |
| 25 45 | ]}, |
| 26 | - {<<"gleam_http">>, [ |
| 27 | - {<<"app">>, <<"gleam_http">>}, |
| 28 | - {<<"optional">>, false}, |
| 29 | - {<<"requirement">>, <<"~> 3.5">>} |
| 30 | - ]}, |
| 31 46 | {<<"glisten">>, [ |
| 32 47 | {<<"app">>, <<"glisten">>}, |
| 33 48 | {<<"optional">>, false}, |
| 34 49 | {<<"requirement">>, <<">= 7.0.0 and < 8.0.0">>} |
| 35 50 | ]}, |
| 36 | - {<<"gleam_otp">>, [ |
| 37 | - {<<"app">>, <<"gleam_otp">>}, |
| 51 | + {<<"gleam_http">>, [ |
| 52 | + {<<"app">>, <<"gleam_http">>}, |
| 38 53 | {<<"optional">>, false}, |
| 39 | - {<<"requirement">>, <<"~> 0.9">>} |
| 40 | - ]}, |
| 41 | - {<<"gleam_stdlib">>, [ |
| 42 | - {<<"app">>, <<"gleam_stdlib">>}, |
| 43 | - {<<"optional">>, false}, |
| 44 | - {<<"requirement">>, <<">= 0.44.0 and < 1.0.0">>} |
| 45 | - ]}, |
| 46 | - {<<"hpack_erl">>, [ |
| 47 | - {<<"app">>, <<"hpack_erl">>}, |
| 48 | - {<<"optional">>, false}, |
| 49 | - {<<"requirement">>, <<"~> 0.3">>} |
| 50 | - ]}, |
| 51 | - {<<"birl">>, [ |
| 52 | - {<<"app">>, <<"birl">>}, |
| 53 | - {<<"optional">>, false}, |
| 54 | - {<<"requirement">>, <<"~> 1.3">>} |
| 55 | - ]}, |
| 56 | - {<<"gramps">>, [ |
| 57 | - {<<"app">>, <<"gramps">>}, |
| 58 | - {<<"optional">>, false}, |
| 59 | - {<<"requirement">>, <<">= 3.0.0 and < 4.0.0">>} |
| 54 | + {<<"requirement">>, <<"~> 3.5">>} |
| 60 55 | ]} |
| 61 56 | ]}. |
| 62 57 | {<<"files">>, [ |
| @@ -1,8 +1,7 @@ | |
| 1 1 | {application, mist, [ |
| 2 2 | {mod, {'mist@internal@clock', []}}, |
| 3 | - {vsn, "4.0.1"}, |
| 4 | - {applications, [birl, |
| 5 | - gleam_erlang, |
| 3 | + {vsn, "4.0.2"}, |
| 4 | + {applications, [gleam_erlang, |
| 6 5 | gleam_http, |
| 7 6 | gleam_otp, |
| 8 7 | gleam_stdlib, |
| @@ -39,9 +39,9 @@ | |
| 39 39 | mist@internal@buffer:buffer(), |
| 40 40 | boolean()}. |
| 41 41 | |
| 42 | - -opaque builder(RIF, RIG) :: {builder, |
| 42 | + -opaque builder(PTS, PTT) :: {builder, |
| 43 43 | integer(), |
| 44 | - fun((gleam@http@request:request(RIF)) -> gleam@http@response:response(RIG)), |
| 44 | + fun((gleam@http@request:request(PTS)) -> gleam@http@response:response(PTT)), |
| 45 45 | fun((integer(), gleam@http:scheme(), ip_address()) -> nil), |
| 46 46 | binary(), |
| 47 47 | boolean()}. |
| @@ -58,11 +58,11 @@ | |
| 58 58 | -type https_error() :: {glisten_error, glisten:start_error()} | |
| 59 59 | {certificate_error, certificate_error()}. |
| 60 60 | |
| 61 | - -type websocket_message(RIH) :: {text, binary()} | |
| 61 | + -type websocket_message(PTU) :: {text, binary()} | |
| 62 62 | {binary, bitstring()} | |
| 63 63 | closed | |
| 64 64 | shutdown | |
| 65 | - {custom, RIH}. |
| 65 | + {custom, PTU}. |
| 66 66 | |
| 67 67 | -opaque sse_connection() :: {sse_connection, mist@internal@http:connection()}. |
| 68 68 | |
| @@ -71,7 +71,7 @@ | |
| 71 71 | gleam@option:option(binary()), |
| 72 72 | gleam@string_tree:string_tree()}. |
| 73 73 | |
| 74 | - -file("/home/alex/gleams/mist/src/mist.gleam", 60). |
| 74 | + -file("/Users/amanning/code/mist/src/mist.gleam", 60). |
| 75 75 | -spec to_mist_ip_address(glisten:ip_address()) -> ip_address(). |
| 76 76 | to_mist_ip_address(Ip) -> |
| 77 77 | case Ip of |
| @@ -82,7 +82,7 @@ to_mist_ip_address(Ip) -> | |
| 82 82 | {ip_v6, A@1, B@1, C@1, D@1, E, F, G, H} |
| 83 83 | end. |
| 84 84 | |
| 85 | - -file("/home/alex/gleams/mist/src/mist.gleam", 67). |
| 85 | + -file("/Users/amanning/code/mist/src/mist.gleam", 67). |
| 86 86 | -spec to_glisten_ip_address(ip_address()) -> glisten:ip_address(). |
| 87 87 | to_glisten_ip_address(Ip) -> |
| 88 88 | case Ip of |
| @@ -93,12 +93,12 @@ to_glisten_ip_address(Ip) -> | |
| 93 93 | {ip_v6, A@1, B@1, C@1, D@1, E, F, G, H} |
| 94 94 | end. |
| 95 95 | |
| 96 | - -file("/home/alex/gleams/mist/src/mist.gleam", 56). |
| 96 | + -file("/Users/amanning/code/mist/src/mist.gleam", 56). |
| 97 97 | -spec ip_address_to_string(ip_address()) -> binary(). |
| 98 98 | ip_address_to_string(Address) -> |
| 99 99 | glisten:ip_address_to_string(to_glisten_ip_address(Address)). |
| 100 100 | |
| 101 | - -file("/home/alex/gleams/mist/src/mist.gleam", 79). |
| 101 | + -file("/Users/amanning/code/mist/src/mist.gleam", 79). |
| 102 102 | -spec get_client_info(mist@internal@http:connection()) -> {ok, |
| 103 103 | connection_info()} | |
| 104 104 | {error, nil}. |
| @@ -120,7 +120,7 @@ get_client_info(Conn) -> | |
| 120 120 | end |
| 121 121 | ). |
| 122 122 | |
| 123 | - -file("/home/alex/gleams/mist/src/mist.gleam", 115). |
| 123 | + -file("/Users/amanning/code/mist/src/mist.gleam", 115). |
| 124 124 | -spec convert_file_errors(mist@internal@file:file_error()) -> file_error(). |
| 125 125 | convert_file_errors(Err) -> |
| 126 126 | case Err of |
| @@ -137,7 +137,7 @@ convert_file_errors(Err) -> | |
| 137 137 | unknown_file_error |
| 138 138 | end. |
| 139 139 | |
| 140 | - -file("/home/alex/gleams/mist/src/mist.gleam", 129). |
| 140 | + -file("/Users/amanning/code/mist/src/mist.gleam", 129). |
| 141 141 | -spec send_file(binary(), integer(), gleam@option:option(integer())) -> {ok, |
| 142 142 | response_data()} | |
| 143 143 | {error, file_error()}. |
| @@ -156,7 +156,7 @@ send_file(Path, Offset, Limit) -> | |
| 156 156 | end |
| 157 157 | ). |
| 158 158 | |
| 159 | - -file("/home/alex/gleams/mist/src/mist.gleam", 159). |
| 159 | + -file("/Users/amanning/code/mist/src/mist.gleam", 159). |
| 160 160 | -spec read_body( |
| 161 161 | gleam@http@request:request(mist@internal@http:connection()), |
| 162 162 | integer() |
| @@ -175,7 +175,7 @@ read_body(Req, Max_body_limit) -> | |
| 175 175 | {error, excess_body} |
| 176 176 | end end)(_pipe@3). |
| 177 177 | |
| 178 | - -file("/home/alex/gleams/mist/src/mist.gleam", 188). |
| 178 | + -file("/Users/amanning/code/mist/src/mist.gleam", 188). |
| 179 179 | -spec do_stream( |
| 180 180 | gleam@http@request:request(mist@internal@http:connection()), |
| 181 181 | mist@internal@buffer:buffer() |
| @@ -237,7 +237,7 @@ do_stream(Req, Buffer) -> | |
| 237 237 | end |
| 238 238 | end. |
| 239 239 | |
| 240 | - -file("/home/alex/gleams/mist/src/mist.gleam", 253). |
| 240 | + -file("/Users/amanning/code/mist/src/mist.gleam", 253). |
| 241 241 | -spec fetch_chunks_until( |
| 242 242 | glisten@socket:socket(), |
| 243 243 | glisten@transport:transport(), |
| @@ -329,7 +329,7 @@ fetch_chunks_until(Socket, Transport, State, Byte_size) -> | |
| 329 329 | end |
| 330 330 | end. |
| 331 331 | |
| 332 | - -file("/home/alex/gleams/mist/src/mist.gleam", 233). |
| 332 | + -file("/Users/amanning/code/mist/src/mist.gleam", 233). |
| 333 333 | -spec do_stream_chunked( |
| 334 334 | gleam@http@request:request(mist@internal@http:connection()), |
| 335 335 | chunk_state() |
| @@ -348,7 +348,7 @@ do_stream_chunked(Req, State) -> | |
| 348 348 | {error, malformed_body} |
| 349 349 | end end. |
| 350 350 | |
| 351 | - -file("/home/alex/gleams/mist/src/mist.gleam", 305). |
| 351 | + -file("/Users/amanning/code/mist/src/mist.gleam", 305). |
| 352 352 | -spec stream(gleam@http@request:request(mist@internal@http:connection())) -> {ok, |
| 353 353 | fun((integer()) -> {ok, chunk()} | {error, read_error()})} | |
| 354 354 | {error, read_error()}. |
| @@ -412,10 +412,10 @@ stream(Req) -> | |
| 412 412 | end |
| 413 413 | ). |
| 414 414 | |
| 415 | - -file("/home/alex/gleams/mist/src/mist.gleam", 356). |
| 415 | + -file("/Users/amanning/code/mist/src/mist.gleam", 356). |
| 416 416 | -spec new( |
| 417 | - fun((gleam@http@request:request(RJE)) -> gleam@http@response:response(RJG)) |
| 418 | - ) -> builder(RJE, RJG). |
| 417 | + fun((gleam@http@request:request(PUR)) -> gleam@http@response:response(PUT)) |
| 418 | + ) -> builder(PUR, PUT). |
| 419 419 | new(Handler) -> |
| 420 420 | {builder, |
| 421 421 | 4000, |
| @@ -440,17 +440,17 @@ new(Handler) -> | |
| 440 440 | <<"localhost"/utf8>>, |
| 441 441 | false}. |
| 442 442 | |
| 443 | - -file("/home/alex/gleams/mist/src/mist.gleam", 380). |
| 444 | - -spec port(builder(RJK, RJL), integer()) -> builder(RJK, RJL). |
| 443 | + -file("/Users/amanning/code/mist/src/mist.gleam", 380). |
| 444 | + -spec port(builder(PUX, PUY), integer()) -> builder(PUX, PUY). |
| 445 445 | port(Builder, Port) -> |
| 446 446 | erlang:setelement(2, Builder, Port). |
| 447 447 | |
| 448 | - -file("/home/alex/gleams/mist/src/mist.gleam", 387). |
| 448 | + -file("/Users/amanning/code/mist/src/mist.gleam", 387). |
| 449 449 | -spec read_request_body( |
| 450 | - builder(bitstring(), RJQ), |
| 450 | + builder(bitstring(), PVD), |
| 451 451 | integer(), |
| 452 | - gleam@http@response:response(RJQ) |
| 453 | - ) -> builder(mist@internal@http:connection(), RJQ). |
| 452 | + gleam@http@response:response(PVD) |
| 453 | + ) -> builder(mist@internal@http:connection(), PVD). |
| 454 454 | read_request_body(Builder, Bytes_limit, Failure_response) -> |
| 455 455 | Handler = fun(Request) -> case read_body(Request, Bytes_limit) of |
| 456 456 | {ok, Request@1} -> |
| @@ -466,25 +466,25 @@ read_request_body(Builder, Bytes_limit, Failure_response) -> | |
| 466 466 | erlang:element(5, Builder), |
| 467 467 | erlang:element(6, Builder)}. |
| 468 468 | |
| 469 | - -file("/home/alex/gleams/mist/src/mist.gleam", 409). |
| 469 | + -file("/Users/amanning/code/mist/src/mist.gleam", 409). |
| 470 470 | -spec after_start( |
| 471 | - builder(RJW, RJX), |
| 471 | + builder(PVJ, PVK), |
| 472 472 | fun((integer(), gleam@http:scheme(), ip_address()) -> nil) |
| 473 | - ) -> builder(RJW, RJX). |
| 473 | + ) -> builder(PVJ, PVK). |
| 474 474 | after_start(Builder, After_start) -> |
| 475 475 | erlang:setelement(4, Builder, After_start). |
| 476 476 | |
| 477 | - -file("/home/alex/gleams/mist/src/mist.gleam", 420). |
| 478 | - -spec bind(builder(RKC, RKD), binary()) -> builder(RKC, RKD). |
| 477 | + -file("/Users/amanning/code/mist/src/mist.gleam", 420). |
| 478 | + -spec bind(builder(PVP, PVQ), binary()) -> builder(PVP, PVQ). |
| 479 479 | bind(Builder, Interface) -> |
| 480 480 | erlang:setelement(5, Builder, Interface). |
| 481 481 | |
| 482 | - -file("/home/alex/gleams/mist/src/mist.gleam", 429). |
| 483 | - -spec with_ipv6(builder(RKI, RKJ)) -> builder(RKI, RKJ). |
| 482 | + -file("/Users/amanning/code/mist/src/mist.gleam", 429). |
| 483 | + -spec with_ipv6(builder(PVV, PVW)) -> builder(PVV, PVW). |
| 484 484 | with_ipv6(Builder) -> |
| 485 485 | erlang:setelement(6, Builder, true). |
| 486 486 | |
| 487 | - -file("/home/alex/gleams/mist/src/mist.gleam", 433). |
| 487 | + -file("/Users/amanning/code/mist/src/mist.gleam", 433). |
| 488 488 | -spec convert_body_types(gleam@http@response:response(response_data())) -> gleam@http@response:response(mist@internal@http:response_data()). |
| 489 489 | convert_body_types(Resp) -> |
| 490 490 | New_body = case erlang:element(4, Resp) of |
| @@ -505,17 +505,17 @@ convert_body_types(Resp) -> | |
| 505 505 | end, |
| 506 506 | gleam@http@response:set_body(Resp, New_body). |
| 507 507 | |
| 508 | - -file("/home/alex/gleams/mist/src/mist.gleam", 459). |
| 508 | + -file("/Users/amanning/code/mist/src/mist.gleam", 459). |
| 509 509 | -spec get_supervisor(server()) -> gleam@erlang@process:subject(gleam@otp@supervisor:message()). |
| 510 510 | get_supervisor(Server) -> |
| 511 511 | erlang:element(2, Server). |
| 512 512 | |
| 513 | - -file("/home/alex/gleams/mist/src/mist.gleam", 463). |
| 513 | + -file("/Users/amanning/code/mist/src/mist.gleam", 463). |
| 514 514 | -spec get_port(server()) -> integer(). |
| 515 515 | get_port(Server) -> |
| 516 516 | erlang:element(3, Server). |
| 517 517 | |
| 518 | - -file("/home/alex/gleams/mist/src/mist.gleam", 478). |
| 518 | + -file("/Users/amanning/code/mist/src/mist.gleam", 478). |
| 519 519 | -spec start_http_server( |
| 520 520 | builder(mist@internal@http:connection(), response_data()) |
| 521 521 | ) -> {ok, server()} | {error, glisten:start_error()}. |
| @@ -563,7 +563,7 @@ start_http_server(Builder) -> | |
| 563 563 | end end |
| 564 564 | ). |
| 565 565 | |
| 566 | - -file("/home/alex/gleams/mist/src/mist.gleam", 468). |
| 566 | + -file("/Users/amanning/code/mist/src/mist.gleam", 468). |
| 567 567 | -spec start_http(builder(mist@internal@http:connection(), response_data())) -> {ok, |
| 568 568 | gleam@erlang@process:subject(gleam@otp@supervisor:message())} | |
| 569 569 | {error, glisten:start_error()}. |
| @@ -571,7 +571,7 @@ start_http(Builder) -> | |
| 571 571 | _pipe = start_http_server(Builder), |
| 572 572 | gleam@result:map(_pipe, fun get_supervisor/1). |
| 573 573 | |
| 574 | - -file("/home/alex/gleams/mist/src/mist.gleam", 545). |
| 574 | + -file("/Users/amanning/code/mist/src/mist.gleam", 545). |
| 575 575 | -spec start_https_server( |
| 576 576 | builder(mist@internal@http:connection(), response_data()), |
| 577 577 | binary(), |
| @@ -645,7 +645,7 @@ start_https_server(Builder, Certfile, Keyfile) -> | |
| 645 645 | end |
| 646 646 | ). |
| 647 647 | |
| 648 | - -file("/home/alex/gleams/mist/src/mist.gleam", 533). |
| 648 | + -file("/Users/amanning/code/mist/src/mist.gleam", 533). |
| 649 649 | -spec start_https( |
| 650 650 | builder(mist@internal@http:connection(), response_data()), |
| 651 651 | binary(), |
| @@ -656,10 +656,10 @@ start_https(Builder, Certfile, Keyfile) -> | |
| 656 656 | _pipe = start_https_server(Builder, Certfile, Keyfile), |
| 657 657 | gleam@result:map(_pipe, fun get_supervisor/1). |
| 658 658 | |
| 659 | - -file("/home/alex/gleams/mist/src/mist.gleam", 599). |
| 659 | + -file("/Users/amanning/code/mist/src/mist.gleam", 599). |
| 660 660 | -spec internal_to_public_ws_message( |
| 661 | - mist@internal@websocket:handler_message(RLJ) |
| 662 | - ) -> {ok, websocket_message(RLJ)} | {error, nil}. |
| 661 | + mist@internal@websocket:handler_message(PWW) |
| 662 | + ) -> {ok, websocket_message(PWW)} | {error, nil}. |
| 663 663 | internal_to_public_ws_message(Msg) -> |
| 664 664 | case Msg of |
| 665 665 | {internal, {data, {text_frame, _, Data}}} -> |
| @@ -677,13 +677,13 @@ internal_to_public_ws_message(Msg) -> | |
| 677 677 | {error, nil} |
| 678 678 | end. |
| 679 679 | |
| 680 | - -file("/home/alex/gleams/mist/src/mist.gleam", 624). |
| 680 | + -file("/Users/amanning/code/mist/src/mist.gleam", 624). |
| 681 681 | -spec websocket( |
| 682 682 | gleam@http@request:request(mist@internal@http:connection()), |
| 683 | - fun((RLP, mist@internal@websocket:websocket_connection(), websocket_message(RLQ)) -> gleam@otp@actor:next(RLQ, RLP)), |
| 684 | - fun((mist@internal@websocket:websocket_connection()) -> {RLP, |
| 685 | - gleam@option:option(gleam@erlang@process:selector(RLQ))}), |
| 686 | - fun((RLP) -> nil) |
| 683 | + fun((PXC, mist@internal@websocket:websocket_connection(), websocket_message(PXD)) -> gleam@otp@actor:next(PXD, PXC)), |
| 684 | + fun((mist@internal@websocket:websocket_connection()) -> {PXC, |
| 685 | + gleam@option:option(gleam@erlang@process:selector(PXD))}), |
| 686 | + fun((PXC) -> nil) |
| 687 687 | ) -> gleam@http@response:response(response_data()). |
| 688 688 | websocket(Request, Handler, On_init, On_close) -> |
| 689 689 | Handler@1 = fun(State, Connection, Message) -> _pipe = Message, |
| @@ -748,7 +748,7 @@ websocket(Request, Handler, On_init, On_close) -> | |
| 748 748 | ) end |
| 749 749 | ). |
| 750 750 | |
| 751 | - -file("/home/alex/gleams/mist/src/mist.gleam", 677). |
| 751 | + -file("/Users/amanning/code/mist/src/mist.gleam", 677). |
| 752 752 | -spec send_binary_frame( |
| 753 753 | mist@internal@websocket:websocket_connection(), |
| 754 754 | bitstring() |
| @@ -784,7 +784,7 @@ send_binary_frame(Connection, Frame) -> | |
| 784 784 | line => 695}) |
| 785 785 | end. |
| 786 786 | |
| 787 | - -file("/home/alex/gleams/mist/src/mist.gleam", 701). |
| 787 | + -file("/Users/amanning/code/mist/src/mist.gleam", 701). |
| 788 788 | -spec send_text_frame(mist@internal@websocket:websocket_connection(), binary()) -> {ok, |
| 789 789 | nil} | |
| 790 790 | {error, glisten@socket:socket_reason()}. |
| @@ -819,27 +819,27 @@ send_text_frame(Connection, Frame) -> | |
| 819 819 | line => 719}) |
| 820 820 | end. |
| 821 821 | |
| 822 | - -file("/home/alex/gleams/mist/src/mist.gleam", 739). |
| 822 | + -file("/Users/amanning/code/mist/src/mist.gleam", 739). |
| 823 823 | -spec event(gleam@string_tree:string_tree()) -> sse_event(). |
| 824 824 | event(Data) -> |
| 825 825 | {sse_event, none, none, Data}. |
| 826 826 | |
| 827 | - -file("/home/alex/gleams/mist/src/mist.gleam", 744). |
| 827 | + -file("/Users/amanning/code/mist/src/mist.gleam", 744). |
| 828 828 | -spec event_id(sse_event(), binary()) -> sse_event(). |
| 829 829 | event_id(Event, Id) -> |
| 830 830 | erlang:setelement(2, Event, {some, Id}). |
| 831 831 | |
| 832 | - -file("/home/alex/gleams/mist/src/mist.gleam", 749). |
| 832 | + -file("/Users/amanning/code/mist/src/mist.gleam", 749). |
| 833 833 | -spec event_name(sse_event(), binary()) -> sse_event(). |
| 834 834 | event_name(Event, Name) -> |
| 835 835 | erlang:setelement(3, Event, {some, Name}). |
| 836 836 | |
| 837 | - -file("/home/alex/gleams/mist/src/mist.gleam", 762). |
| 837 | + -file("/Users/amanning/code/mist/src/mist.gleam", 762). |
| 838 838 | -spec server_sent_events( |
| 839 839 | gleam@http@request:request(mist@internal@http:connection()), |
| 840 840 | gleam@http@response:response(any()), |
| 841 | - fun(() -> gleam@otp@actor:init_result(RME, RMF)), |
| 842 | - fun((RMF, sse_connection(), RME) -> gleam@otp@actor:next(RMF, RME)) |
| 841 | + fun(() -> gleam@otp@actor:init_result(PXR, PXS)), |
| 842 | + fun((PXS, sse_connection(), PXR) -> gleam@otp@actor:next(PXS, PXR)) |
| 843 843 | ) -> gleam@http@response:response(response_data()). |
| 844 844 | server_sent_events(Req, Resp, Init, Loop) -> |
| 845 845 | With_default_headers = begin |
| @@ -917,7 +917,7 @@ server_sent_events(Req, Resp, Init, Loop) -> | |
| 917 917 | ) end |
| 918 918 | ). |
| 919 919 | |
| 920 | - -file("/home/alex/gleams/mist/src/mist.gleam", 807). |
| 920 | + -file("/Users/amanning/code/mist/src/mist.gleam", 807). |
| 921 921 | -spec send_event(sse_connection(), sse_event()) -> {ok, nil} | {error, nil}. |
| 922 922 | send_event(Conn, Event) -> |
| 923 923 | {sse_connection, Conn@1} = Conn, |
Loading more files…