Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More clarity around GetInfo and List #158

Merged
merged 5 commits into from
Sep 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions adr/ADR-20.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Initial feature list:
- Represent an object store.
- Store a large quantity of related bytes in chunks as a single object.
- Retrieve all the bytes from a single object
- Store meta data regarding each object
- Store metadata regarding each object
- Store multiple objects in a single store
- Ability to specify chunk size
- Ability to delete an object
Expand Down Expand Up @@ -316,11 +316,12 @@ Get will retrieve the named object from the object store.

* Deleted objects should be treated the same as objects that don't exist.

At least one variant of:
At least one \[language specific] variant of:

```
Get(name string) -> [Language specific handling, output/stream/writer]
Get(name string) -> [Language specific handling output/stream/writer]
Get(name string, [output/stream/writer]) -> ObjectInfo
Get(name string) -> ObjectResult, error
```

Optional/Convenience examples:
Expand All @@ -333,21 +334,27 @@ GetFile(name string, file string)

**GetInfo**

GetInfo will retrieve the current information for the object, including the info of a Deleted object.
GetInfo will retrieve the current information for the object.
* Do not return info for deleted objects, except with optional convenience methods.

```
GetInfo(name string) -> ObjectInfo
```

Optional/Convenience examples:

```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example is written in Go from what I see, but Go does not have method overloading (just variadinc arguments with ...). So in go, the method signature looks something like this:

Get(name string, opts ...GetObjectOpt) (ObjectResult, error)

And usage would be:

// will return error if object is deleted
obj, err := obs.Get("A")

// will return deleted object
obj, err := obs.Get("A", GetObjectShowDeleted())

GetInfo(name string, includingDeleted bool) -> ObjectInfo
GetInfo(name string, opts ...WatchOpt) -> ObjectInfo
```

**UpdateMeta**

UpdateMeta will update **some** metadata for the object.
* Only the name, description and headers can be updated.
* Objects, Links and Bucket Links are all allowed to be updated.
* It is okay to change the name if the name does not exist.
* It is okay to change the name to that of an existing but deleted object.
* It is an error to change the name to that of an existing but not deleted object.
* It is an error to update metadata for a deleted object.
* It is an error to rename an object to the name of an existing object

```
UpdateMeta(name string, meta ObjectMeta)
Expand Down Expand Up @@ -388,11 +395,10 @@ Watch(opts ...WatchOpt) -> ObjectWatcher
**List**

List will list all the objects in this store.

* Should not include deleted objects.
* When listing objects, filter those objects that have been deleted. If necessary or requested, provide convenience methods or optional arguments to include them if the API user desires them.

```
List(opts ...WatchOpt) -> List or array of ObjectInfo
List() -> List or array of ObjectInfo
```

**Status**
Expand Down