Resource

container

this defines the container resource

resource container;

F name

name: func() -> result​<string, error>;

returns container name

F get-data

get-data: func(name: object-name, start: u64, end: u64) -> result​<incoming-value, error>;

retrieves an object or portion of an object, as a resource. Start and end offsets are inclusive. Once a data-blob resource has been created, the underlying bytes are held by the blobstore service for the lifetime of the data-blob resource, even if the object they came from is later deleted.

F write-data

write-data: func(name: object-name, data: borrow​<outgoing-value>) -> result​<_, error>;

creates or replaces an object with the data blob.

F list-objects

list-objects: func() -> result​<stream-object-names, error>;

returns list of objects in the container. Order is undefined.

F delete-object

delete-object: func(name: object-name) -> result​<_, error>;

deletes object. does not return error if object did not exist.

F delete-objects

delete-objects: func(names: list​<object-name>) -> result​<_, error>;

deletes multiple objects in the container

F has-object

has-object: func(name: object-name) -> result​<bool, error>;

returns true if the object exists in this container

F clear

clear: func() -> result​<_, error>;

removes all objects within the container, leaving the container empty.