Skip to content

Commit 22076e3

Browse files
committed
Update for Gleam v0.32
1 parent 0c9e691 commit 22076e3

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

gleam.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "gleam_hackney"
22
version = "1.1.0"
3-
gleam = ">= 0.30.0"
3+
gleam = ">= 0.32.0"
44

55
description = "Gleam bindings to the Hackney HTTP client"
66
licences = ["Apache-2.0"]
@@ -12,9 +12,9 @@ links = [
1212
]
1313

1414
[dependencies]
15-
gleam_stdlib = "~> 0.18"
15+
gleam_stdlib = "~> 0.32"
1616
gleam_http = "~> 3.0"
1717
hackney = "~> 1.18"
1818

1919
[dev-dependencies]
20-
gleeunit = "~> 0.5"
20+
gleeunit = "~> 1.0"

manifest.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22
# You typically do not need to edit this file
33

44
packages = [
5-
{ name = "certifi", version = "2.9.0", build_tools = ["rebar3"], requirements = [], otp_app = "certifi", source = "hex", outer_checksum = "266DA46BDB06D6C6D35FDE799BCB28D36D985D424AD7C08B5BB48F5B5CDD4641" },
6-
{ name = "gleam_http", version = "3.4.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_http", source = "hex", outer_checksum = "B6EB76D304E0E66267485983E6B7BC28F3BFA6795BB2BF90FC411F6903AF6A1A" },
7-
{ name = "gleam_stdlib", version = "0.30.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "03710B3DA047A3683117591707FCA19D32B980229DD8CE8B0603EB5B5144F6C3" },
8-
{ name = "gleeunit", version = "0.10.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "ECEA2DE4BE6528D36AFE74F42A21CDF99966EC36D7F25DEB34D47DD0F7977BAF" },
9-
{ name = "hackney", version = "1.18.1", build_tools = ["rebar3"], requirements = ["mimerl", "idna", "metrics", "certifi", "ssl_verify_fun", "parse_trans", "unicode_util_compat"], otp_app = "hackney", source = "hex", outer_checksum = "A4ECDAFF44297E9B5894AE499E9A070EA1888C84AFDD1FD9B7B2BC384950128E" },
5+
{ name = "certifi", version = "2.12.0", build_tools = ["rebar3"], requirements = [], otp_app = "certifi", source = "hex", outer_checksum = "EE68D85DF22E554040CDB4BE100F33873AC6051387BAF6A8F6CE82272340FF1C" },
6+
{ name = "gleam_http", version = "3.5.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_http", source = "hex", outer_checksum = "0B09AAE8EB547C4F2F2D3F8917A0A4D2EF75DFF0232389332BAFE19DBBFDB92B" },
7+
{ name = "gleam_stdlib", version = "0.32.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "07D64C26D014CF570F8ACADCE602761EA2E74C842D26F2FD49B0D61973D9966F" },
8+
{ name = "gleeunit", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "D3682ED8C5F9CAE1C928F2506DE91625588CC752495988CBE0F5653A42A6F334" },
9+
{ name = "hackney", version = "1.20.1", build_tools = ["rebar3"], requirements = ["mimerl", "unicode_util_compat", "parse_trans", "ssl_verify_fun", "certifi", "metrics", "idna"], otp_app = "hackney", source = "hex", outer_checksum = "FE9094E5F1A2A2C0A7D10918FEE36BFEC0EC2A979994CFF8CFE8058CD9AF38E3" },
1010
{ name = "idna", version = "6.1.1", build_tools = ["rebar3"], requirements = ["unicode_util_compat"], otp_app = "idna", source = "hex", outer_checksum = "92376EB7894412ED19AC475E4A86F7B413C1B9FBB5BD16DCCD57934157944CEA" },
1111
{ name = "metrics", version = "1.0.1", build_tools = ["rebar3"], requirements = [], otp_app = "metrics", source = "hex", outer_checksum = "69B09ADDDC4F74A40716AE54D140F93BEB0FB8978D8636EADED0C31B6F099F16" },
1212
{ name = "mimerl", version = "1.2.0", build_tools = ["rebar3"], requirements = [], otp_app = "mimerl", source = "hex", outer_checksum = "F278585650AA581986264638EBF698F8BB19DF297F66AD91B18910DFC6E19323" },
13-
{ name = "parse_trans", version = "3.3.1", build_tools = ["rebar3"], requirements = [], otp_app = "parse_trans", source = "hex", outer_checksum = "07CD9577885F56362D414E8C4C4E6BDF10D43A8767ABB92D24CBE8B24C54888B" },
13+
{ name = "parse_trans", version = "3.4.1", build_tools = ["rebar3"], requirements = [], otp_app = "parse_trans", source = "hex", outer_checksum = "620A406CE75DADA827B82E453C19CF06776BE266F5A67CFF34E1EF2CBB60E49A" },
1414
{ name = "ssl_verify_fun", version = "1.1.7", build_tools = ["mix", "rebar3", "make"], requirements = [], otp_app = "ssl_verify_fun", source = "hex", outer_checksum = "FE4C190E8F37401D30167C8C405EDA19469F34577987C76DDE613E838BBC67F8" },
1515
{ name = "unicode_util_compat", version = "0.7.0", build_tools = ["rebar3"], requirements = [], otp_app = "unicode_util_compat", source = "hex", outer_checksum = "25EEE6D67DF61960CF6A794239566599B09E17E668D3700247BC498638152521" },
1616
]
1717

1818
[requirements]
1919
gleam_http = { version = "~> 3.0" }
20-
gleam_stdlib = { version = "~> 0.18" }
21-
gleeunit = { version = "~> 0.5" }
20+
gleam_stdlib = { version = "~> 0.32" }
21+
gleeunit = { version = "~> 1.0" }
2222
hackney = { version = "~> 1.18" }

src/gleam/hackney.gleam

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import gleam/result
2-
import gleam/dynamic.{Dynamic}
3-
import gleam/http.{Method}
4-
import gleam/http/request.{Request}
5-
import gleam/http/response.{Response}
6-
import gleam/bit_string
7-
import gleam/bit_builder.{BitBuilder}
2+
import gleam/dynamic.{type Dynamic}
3+
import gleam/http.{type Method}
4+
import gleam/http/request.{type Request}
5+
import gleam/http/response.{type Response, Response}
6+
import gleam/bit_array
7+
import gleam/bytes_builder.{type BytesBuilder}
88
import gleam/string
99
import gleam/list
1010
import gleam/uri
@@ -20,13 +20,13 @@ fn ffi_send(
2020
a: Method,
2121
b: String,
2222
c: List(http.Header),
23-
d: BitBuilder,
24-
) -> Result(Response(BitString), Error)
23+
d: BytesBuilder,
24+
) -> Result(Response(BitArray), Error)
2525

2626
// TODO: test
2727
pub fn send_bits(
28-
request: Request(BitBuilder),
29-
) -> Result(Response(BitString), Error) {
28+
request: Request(BytesBuilder),
29+
) -> Result(Response(BitArray), Error) {
3030
use response <- result.then(
3131
request
3232
|> request.to_uri
@@ -40,11 +40,11 @@ pub fn send_bits(
4040
pub fn send(req: Request(String)) -> Result(Response(String), Error) {
4141
use resp <- result.then(
4242
req
43-
|> request.map(bit_builder.from_string)
43+
|> request.map(bytes_builder.from_string)
4444
|> send_bits,
4545
)
4646

47-
case bit_string.to_string(resp.body) {
47+
case bit_array.to_string(resp.body) {
4848
Ok(body) -> Ok(response.set_body(resp, body))
4949
Error(_) -> Error(InvalidUtf8Response)
5050
}

0 commit comments

Comments
 (0)