Source File
json.go
Belonging Package
github.com/gorilla/websocket
// Copyright 2013 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 ()// WriteJSON writes the JSON encoding of v as a message.//// Deprecated: Use c.WriteJSON instead.func ( *Conn, interface{}) error {return .WriteJSON()}// WriteJSON writes the JSON encoding of v as a message.//// See the documentation for encoding/json Marshal for details about the// conversion of Go values to JSON.func ( *Conn) ( interface{}) error {, := .NextWriter(TextMessage)if != nil {return}:= json.NewEncoder().Encode():= .Close()if != nil {return}return}// ReadJSON reads the next JSON-encoded message from the connection and stores// it in the value pointed to by v.//// Deprecated: Use c.ReadJSON instead.func ( *Conn, interface{}) error {return .ReadJSON()}// ReadJSON reads the next JSON-encoded message from the connection and stores// it in the value pointed to by v.//// See the documentation for the encoding/json Unmarshal function for details// about the conversion of JSON to a Go value.func ( *Conn) ( interface{}) error {, , := .NextReader()if != nil {return}= json.NewDecoder().Decode()if == io.EOF {// One value is expected in the message.= io.ErrUnexpectedEOF}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. |