| // Copyright 2015 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| |
| package stream |
| |
| import ( |
| "io" |
| "v.io/v23/naming" |
| "v.io/v23/security" |
| |
| "v.io/x/ref/runtime/internal/lib/upcqueue" |
| ) |
| |
| type XFlow interface { |
| Flow |
| |
| // DisableEncryption disables encryption for the flow. All bytes |
| // written afterward will be sent in the clear. All calls after the |
| // first have no effect. |
| DisableEncryption() |
| } |
| |
| type XManager interface { |
| Listen(protocol, address string, principal security.Principal, blessings security.Blessings, opts ...ListenerOpt) (XListener, naming.Endpoint, error) |
| Dial(remote naming.Endpoint, principal security.Principal, opts ...VCOpt) (XFlow, error) |
| Shutdown() |
| RoutingID() naming.RoutingID |
| } |
| |
| type XConn interface { |
| io.ReadWriteCloser |
| |
| // DisableEncryption disables encryption for the flow. All bytes |
| // written afterward will be sent in the clear. All calls after the |
| // first have no effect. |
| DisableEncryption() |
| } |
| |
| type XListener interface { |
| Accept() (XFlow, error) |
| Close() error |
| } |
| |
| // TODO(mattr): XVC doesn't need to be an interface, and shouldn't be in the |
| // model file. |
| type XVC interface { |
| Connect(opts ...FlowOpt) (XFlow, error) |
| ListenTo(q *upcqueue.T) error |
| // Close closes the VC and all flows on it, allowing any pending writes in |
| // flows to drain. |
| Close(reason error) error |
| Closed() chan struct{} |
| VCDataCache() VCDataCache |
| } |