Skip to content
openstack object-storage client for browser
JavaScript HTML
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
dist
examples
src
.gitignore
README.md
bower.json
gulpfile.js
package.json

README.md

osos

an openstack object-storage client for browser

usage

creating a client

var client = new osos.Client({
    baseUrl: "http://object-storage.com/v1/project",
    token: "token"
});

uploading

uploading large file

var promise = client.upload(file, container, {
    sliceSize: 2, // Mb
    concurrency: 2,
    retry: 3
});

promise.then(function() {
    console.log("done");
});

uploading small file

client.directUpload(file, container);

progress

client.upload(file, container, {
    onProgress: function(progress) {
        console.log(progress);
    }
})

more api

client.listContainers();
client.listOjbects(container);
client.delObject(container, object);

examples

working in progress examples included, reactjs is required(run bower install)

a proxy is also needed, nginx can be configured as following:

server {
    listen 8000;
    root /path/to/osos/;
    client_max_body_size 20M;

    location /v1 {
        proxy_pass http://object-storage:8080;
    }
}

after nginx is setup, visit localhost:8000/examples/list.html and localhost:8000/examples/upload.html

building osos.js

just run:

gulp

dependencies

  • depends on native es6 Promise, you might need a shim for older browsers
  • spark-md5 for upload
Something went wrong with that request. Please try again.