MCPcopy Create free account
hub / github.com/goinaction/code / New

Function New

chapter10/listing06/pubsub/pubsub.go:13–21  ·  view source on GitHub ↗

New creates a pubsub value for use.

(host string)

Source from the content-addressed store, hash-verified

11
12// New creates a pubsub value for use.
13func New(host string) *PubSub {
14 ps := PubSub{
15 host: host,
16 }
17
18 // PRETEND THERE IS A SPECIFIC IMPLEMENTATION.
19
20 return &ps
21}
22
23// Publish sends the data for the specified key.
24func (ps *PubSub) Publish(key string, v interface{}) error {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected