 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- Variables
- func ReadNextToken(rw io.ReadWriter) (string, error)
- func SelectOneOf(protos []string, rwc io.ReadWriteCloser) (string, error)
- func SelectProtoOrFail(proto string, rwc io.ReadWriteCloser) error
- type HandlerFunc
- type Multistream
- type MultistreamMuxer
- func (msm *MultistreamMuxer) AddHandler(protocol string, handler HandlerFunc)
- func (msm *MultistreamMuxer) Handle(rwc io.ReadWriteCloser) error
- func (msm *MultistreamMuxer) Ls(rwc io.Writer) error
- func (msm *MultistreamMuxer) Negotiate(rwc io.ReadWriteCloser) (string, HandlerFunc, error)
- func (msm *MultistreamMuxer) Protocols() []string
- func (msm *MultistreamMuxer) RemoveHandler(protocol string)
 
Constants ¶
      View Source
      
  
const ProtocolID = "/multistream/1.0.0"
    Variables ¶
      View Source
      
  
    var ErrNotSupported = errors.New("protocol not supported")
    
      View Source
      
  
var ErrTooLarge = errors.New("incoming message was too large")
    Functions ¶
func ReadNextToken ¶
func ReadNextToken(rw io.ReadWriter) (string, error)
func SelectOneOf ¶
func SelectOneOf(protos []string, rwc io.ReadWriteCloser) (string, error)
func SelectProtoOrFail ¶
func SelectProtoOrFail(proto string, rwc io.ReadWriteCloser) error
Types ¶
type HandlerFunc ¶
type HandlerFunc func(io.ReadWriteCloser) error
type Multistream ¶
type Multistream interface {
	io.ReadWriteCloser
	Protocol() string
}
    func NewMSSelect ¶
func NewMSSelect(c io.ReadWriteCloser, proto string) Multistream
func NewMultistream ¶
func NewMultistream(c io.ReadWriteCloser, proto string) Multistream
type MultistreamMuxer ¶
type MultistreamMuxer struct {
	// contains filtered or unexported fields
}
    func NewMultistreamMuxer ¶
func NewMultistreamMuxer() *MultistreamMuxer
func (*MultistreamMuxer) AddHandler ¶
func (msm *MultistreamMuxer) AddHandler(protocol string, handler HandlerFunc)
func (*MultistreamMuxer) Handle ¶
func (msm *MultistreamMuxer) Handle(rwc io.ReadWriteCloser) error
func (*MultistreamMuxer) Negotiate ¶
func (msm *MultistreamMuxer) Negotiate(rwc io.ReadWriteCloser) (string, HandlerFunc, error)
func (*MultistreamMuxer) Protocols ¶
func (msm *MultistreamMuxer) Protocols() []string
func (*MultistreamMuxer) RemoveHandler ¶
func (msm *MultistreamMuxer) RemoveHandler(protocol string)
 Click to show internal directories. 
   Click to hide internal directories.