Skip to content

Commit b2cc711

Browse files
Merge pull request #21 from RelationalAI/ag-dynamic-conf
Dynamic configuration API and S3 support
2 parents fbaaebd + 081db64 commit b2cc711

10 files changed

+992
-330
lines changed

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@ version = "0.1.0"
44

55
[deps]
66
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
7+
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
78
object_store_ffi_jll = "0e112785-0821-598c-8835-9f07837e8d7b"
89

910
[compat]
1011
CloudBase = "1"
1112
DocStringExtensions = "0.9"
1213
HTTP = "1"
14+
JSON3 = "1.13"
1315
ReTestItems = "1"
1416
Sockets = "1"
1517
Test = "1"
1618
julia = "1.8"
17-
object_store_ffi_jll = "0.1"
19+
object_store_ffi_jll = "0.2"
1820

1921
[extras]
2022
CloudBase = "85eb1798-d7c4-4918-bb13-c944d38e27ed"

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,26 @@ using RustyObjectStore
1717
init_object_store()
1818
```
1919

20-
Requests are sent via calling `blob_put` or `blob_get!`, providing the location of the object to put/get, either the data to send or a buffer that will receive data, and credentials.
21-
For `blob_put` the data must be a vector of bytes (`UInt8`).
22-
For `blob_get!` the buffer must be a vector into which bytes (`UInt8`) can be written.
20+
Requests are sent via calling `put_object` or `get_object!`, providing the location of the object to put/get, either the data to send or a buffer that will receive data, and credentials.
21+
For `put_object` the data must be a vector of bytes (`UInt8`).
22+
For `get_object!` the buffer must be a vector into which bytes (`UInt8`) can be written.
2323
```julia
24-
credentials = AzureCredentials("my_account", "my_container", "my_key")
24+
using RustyObjectStore: get_object!, put_object, AzureConfig
25+
26+
config = AzureConfig(
27+
storage_account_name="my_account",
28+
container_name="my_container",
29+
storage_account_key="my_key"
30+
)
2531
input = "1,2,3,4,5,6,7,8,9,0\n" ^ 5 # 100 B
2632

27-
nbytes_written = blob_put("path/to/example.csv", codeunits(input), credentials)
33+
nbytes_written = put_object(codeunits(input), "path/to/example.csv", config)
2834
@assert nbytes_written == 100
2935

3036
buffer = Vector{UInt8}(undef, 1000) # 1000 B
3137
@assert sizeof(buffer) > sizeof(input)
3238

33-
nbytes_read = blob_get!("path/to/example.csv", buffer, credentials)
39+
nbytes_read = get_object!(buffer, "path/to/example.csv", config)
3440
@assert nbytes_read == 100
3541
@assert String(buffer[1:nbytes_read]) == input
3642
```

0 commit comments

Comments
 (0)