2015-09-09 18:50:21 -04:00
|
|
|
package core
|
|
|
|
|
|
|
|
type VRay struct {
|
|
|
|
Input chan []byte
|
|
|
|
Output chan []byte
|
|
|
|
}
|
|
|
|
|
2015-09-10 18:24:18 -04:00
|
|
|
func NewVRay() VRay {
|
|
|
|
return VRay{make(chan []byte, 128), make(chan []byte, 128)}
|
2015-09-09 18:50:21 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
type OutboundVRay interface {
|
|
|
|
OutboundInput() <-chan []byte
|
|
|
|
OutboundOutput() chan<- []byte
|
|
|
|
}
|
|
|
|
|
|
|
|
type InboundVRay interface {
|
|
|
|
InboundInput() chan<- []byte
|
2015-09-10 18:24:18 -04:00
|
|
|
InboundOutput() <-chan []byte
|
2015-09-09 18:50:21 -04:00
|
|
|
}
|
|
|
|
|
2015-09-10 18:24:18 -04:00
|
|
|
func (ray VRay) OutboundInput() <-chan []byte {
|
2015-09-09 18:50:21 -04:00
|
|
|
return ray.Input
|
|
|
|
}
|
|
|
|
|
2015-09-10 18:24:18 -04:00
|
|
|
func (ray VRay) OutboundOutput() chan<- []byte {
|
2015-09-09 18:50:21 -04:00
|
|
|
return ray.Output
|
|
|
|
}
|
|
|
|
|
2015-09-10 18:24:18 -04:00
|
|
|
func (ray VRay) InboundInput() chan<- []byte {
|
2015-09-09 18:50:21 -04:00
|
|
|
return ray.Input
|
|
|
|
}
|
|
|
|
|
2015-09-10 18:24:18 -04:00
|
|
|
func (ray VRay) InboundOutput() <-chan []byte {
|
2015-09-09 18:50:21 -04:00
|
|
|
return ray.Output
|
|
|
|
}
|