Source File
join.go
Belonging Package
github.com/gorilla/websocket
// Copyright 2019 The Gorilla WebSocket 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 websocketimport ()// JoinMessages concatenates received messages to create a single io.Reader.// The string term is appended to each message. The returned reader does not// support concurrent calls to the Read method.func ( *Conn, string) io.Reader {return &joinReader{c: , term: }}type joinReader struct {c *Connterm stringr io.Reader}func ( *joinReader) ( []byte) (int, error) {if .r == nil {var error_, .r, = .c.NextReader()if != nil {return 0,}if .term != "" {.r = io.MultiReader(.r, strings.NewReader(.term))}}, := .r.Read()if == io.EOF {= nil.r = nil}return ,}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |