ipfs / go-ipfs-gateway

Go implementation of the HTTP-to-IPFS gateway -- currently lives in go-ipfs
https://github.com/ipfs/go-ipfs
MIT License
17 stars 6 forks source link

Adopt a statemachine-like request model #3

Open ghost opened 8 years ago

ghost commented 8 years ago

Webmachine has been pioneered in CouchDB and its goal is to encode most of HTTP's logic in a finite statemachine (FSM).

webmachine fsm

The gateway would be a resource, implementing decision functions for a few of webmachine's states. An inofficial and very old Go implementation exists at https://github.com/pomack/webmachine.go. I used to work on the official Ruby implementation, and example resouce code is here: https://github.com/webmachine/webmachine-ruby/blob/master/documentation/examples.md

I think webmachine is a very sane model of HTTP resources, and will make it a lot easier for us to specify, develop, and reason about the IPFS gateway.

ghost commented 8 years ago

ping @Kubuxu just because you're not watching this repo yet :]