Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/embeddedenterprises/wuploader
WAMP multipart file upload handler for golang
https://github.com/embeddedenterprises/wuploader
binary-data file-upload go golang messaging microservice service wamp wamp-client wamp-protocol websockets
Last synced: about 2 months ago
JSON representation
WAMP multipart file upload handler for golang
- Host: GitHub
- URL: https://github.com/embeddedenterprises/wuploader
- Owner: EmbeddedEnterprises
- License: bsd-3-clause
- Created: 2018-08-29T15:40:14.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-09T14:45:50.000Z (about 6 years ago)
- Last Synced: 2024-11-12T07:15:22.125Z (about 2 months ago)
- Topics: binary-data, file-upload, go, golang, messaging, microservice, service, wamp, wamp-client, wamp-protocol, websockets
- Language: Go
- Size: 9.77 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wuploader
wuploader is a file upload utility library for WAMP
This repository uses [nexus](github.com/gammazero/nexus) for WAMP client communication in golang.wuploader is designed to integrate itself into the [service](github.com/EmbeddedEnterprises/service) library but should work when you use pure nexus too.
---
# How it works
You pass an endpoint which should be a file upload to wuploader and it will register a handler providing high level abstractions for file uploads.
# API Description
`wuploader` defines one procedure with the name given to the API with a polymorphic signature.
Uploading is implemented in a transaction based model, which means that you have to start a transaction first:`endpoint('start', uploadSize) -> transactionID: uint64`
When starting a transaction, the endpoint may verify the uploader and the upload size and MAY reject the upload, otherwise a valid transaction ID is returned, which has to be specified for subsequent calls. After the transaction has been started, data can be uploaded like this:
`endpoint('data', transactionID, data) -> uploadPos: uint64`
While uploading, the size of the data chunks may be varied, good sizes range from 32kB to 4MB, depending on the connection speed. After all data has been uploaded, the transaction has to be finished like this:
`endpoint('finish', transactionID, args...) -> result: any`
Finish calls the underlying handler with a consistent binary representation of the uploaded content and forwards any arguments/results to the caller/callee.