github.com/storacha/go-ucanto@v0.7.2/transport/http.go (about) 1 package transport 2 3 import ( 4 "io" 5 "net/http" 6 "net/url" 7 8 "github.com/storacha/go-ucanto/core/result/failure" 9 ) 10 11 type HTTPRequest interface { 12 Headers() http.Header 13 Body() io.Reader 14 } 15 16 type InboundHTTPRequest interface { 17 HTTPRequest 18 URL() *url.URL 19 } 20 21 type HTTPResponse interface { 22 Status() int 23 Headers() http.Header 24 Body() io.ReadCloser 25 } 26 27 type HTTPError interface { 28 failure.Failure 29 Status() int 30 Headers() http.Header 31 }