This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ctx := context.Background() | |
// Start a fake server running locally. | |
srv := pstest.NewServer() | |
defer srv.Close() | |
// Connect to the server without using TLS. | |
conn, err := grpc.Dial(srv.Addr, grpc.WithInsecure()) | |
if err != nil { | |
// TODO: Handle error. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pubsub | |
import ( | |
"context" | |
"cloud.google.com/go/pubsub" | |
"google.golang.org/api/option" | |
) | |
type Publisher struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pubsub | |
import ( | |
"context" | |
"testing" | |
"cloud.google.com/go/pubsub/pstest" | |
"google.golang.org/api/option" | |
"google.golang.org/grpc" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pubsub | |
import ( | |
"context" | |
"fmt" | |
"cloud.google.com/go/pubsub" | |
"google.golang.org/api/option" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pubsub | |
import ( | |
"context" | |
"testing" | |
"time" | |
"cloud.google.com/go/pubsub" | |
"cloud.google.com/go/pubsub/pstest" | |
"google.golang.org/api/option" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pubsub | |
import ( | |
"context" | |
pubsub "cloud.google.com/go/pubsub/apiv1" | |
"google.golang.org/api/option" | |
pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pubsub | |
import ( | |
"context" | |
"testing" | |
"cloud.google.com/go/pubsub/pstest" | |
"google.golang.org/api/option" | |
pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1" | |
"google.golang.org/grpc" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pubsub | |
import ( | |
"context" | |
pubsub "cloud.google.com/go/pubsub/apiv1" | |
"google.golang.org/api/option" | |
pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pubsub | |
import ( | |
"context" | |
"testing" | |
"cloud.google.com/go/pubsub/pstest" | |
"golang.org/x/xerrors" | |
"google.golang.org/api/option" | |
pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1" |