DurableStreams.Protocol.Plug (Streamkeeper v0.3.0)

View Source

Plug router implementing the Durable Streams HTTP protocol.

Phoenix Integration

forward "/v1/stream", DurableStreams.Protocol.Plug

Standalone Usage

# In your application.ex
children = [
  # ... other children
  {Plug.Cowboy, scheme: :http, plug: DurableStreams.Protocol.Plug, options: [port: 4000]}
]

HTTP API

MethodPathPurpose
PUT/:stream_idCreate stream
POST/:stream_idAppend data
GET/:stream_idRead from offset
DELETE/:stream_idDelete stream
HEAD/:stream_idGet metadata

Summary

Functions

Callback implementation for Plug.call/2.

Callback implementation for Plug.init/1.

Functions

call(conn, opts)

Callback implementation for Plug.call/2.

init(opts)

Callback implementation for Plug.init/1.