package channel
import "google.golang.org/appengine/channel"
Package channel implements the server side of App Engine's Channel API.
Create creates a new channel associated with the given clientID, which must be unique to the client that will use the returned token.
token, err := channel.Create(c, "player1") if err != nil { // handle error } // return token to the client in an HTTP response
Send sends a message to the client over the channel identified by clientID.
channel.Send(c, "player1", "Game over!")
Deprecated: The Channel API feature has been deprecated and is going to be removed. See the Channel API Turndown document for details and timetable.
https://cloud.google.com/appengine/docs/deprecations/channel
Index ¶
- func Create(c context.Context, clientID string) (token string, err error)
- func Send(c context.Context, clientID, message string) error
- func SendJSON(c context.Context, clientID string, value interface{}) error
Functions ¶
func Create ¶
Create creates a channel and returns a token for use by the client. The clientID is an application-provided string used to identify the client.
func Send ¶
Send sends a message on the channel associated with clientID.
func SendJSON ¶
SendJSON is a helper function that sends a JSON-encoded value on the channel associated with clientID.
Source Files ¶
channel.go
- Version
- v1.6.1
- Published
- Jun 6, 2019
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 8 hours ago –
Tools for package owners.