From 7cce04cc3a2f119c83a03e72f9260c2b9b9ba1ae Mon Sep 17 00:00:00 2001 From: V2Ray Date: Sat, 10 Oct 2015 12:46:44 +0200 Subject: [PATCH] Doc for ray --- ray.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ray.go b/ray.go index 663b2400..6e55a6e5 100644 --- a/ray.go +++ b/ray.go @@ -21,13 +21,28 @@ func NewRay() *Ray { } } +// OutboundRay is a transport interface for outbound connections. type OutboundRay interface { + // OutboundInput provides a stream for the input of the outbound connection. + // The outbound connection shall write all the input until it is closed. OutboundInput() <-chan *alloc.Buffer + + // OutboundOutput provides a stream to retrieve the response from the + // outbound connection. The outbound connection shall close the channel + // after all responses are receivced and put into the channel. OutboundOutput() chan<- *alloc.Buffer } +// InboundRay is a transport interface for inbound connections. type InboundRay interface { + // InboundInput provides a stream to retrieve the request from client. + // The inbound connection shall close the channel after the entire request + // is received and put into the channel. InboundInput() chan<- *alloc.Buffer + + // InboudBound provides a stream of data for the inbound connection to write + // as response. The inbound connection shall write all the data from the + // channel until it is closed. InboundOutput() <-chan *alloc.Buffer }