Skip to content

Commit

Permalink
feat: add object store methods for listing and removing objects from …
Browse files Browse the repository at this point in the history
…the object store to the documentation (#47)
  • Loading branch information
dfinteligenz committed Jun 16, 2023
1 parent 8f02906 commit e29ef23
Show file tree
Hide file tree
Showing 2 changed files with 178 additions and 111 deletions.
28 changes: 20 additions & 8 deletions content/v2/docs/60_kais_runner_sdk/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,29 @@ context, users will be able to save, get and delete objects. The object store is
ephemeral and, therefore, the persistence of the objects is ensured only during
the execution in which they were created.

Through the context, users will be able to save, get and delete objects.
Through the context, users will be able to save, get, delete list and purge objects.

```python
# Save object
await ctx.object_store.save(key, bytes(large_file, "utf-8"))
```go
// Save object
err := ctx.ObjectStore.Save(key, []byte(value))

// Get object
value, err := ctx.ObjectStore.Get(key)

// Delete object
err := ctx.ObjectStore.Delete(key)

// List objects on the object store
objects, err := ctx.ObjectStore.List()

// List ojbects on the object store with a filter
objects, err := ctx.ObjectStore.List(regexp)

# Get object
object = await ctx.object_store.get(key)
// Purge objects from the object store
err := ctx.ObjectStore.Purge()

# Delete object
await ctx.object_store.delete(key)
// Purge objects from the object store with a filter
err := ctx.ObjectStore.Purge(regexp)
```

### Configuration
Expand Down

0 comments on commit e29ef23

Please sign in to comment.