Skip to content

Commit

Permalink
update proto file and remove references to pilot
Browse files Browse the repository at this point in the history
  • Loading branch information
herinckc committed Sep 9, 2022
1 parent 2fdd773 commit 2c38034
Show file tree
Hide file tree
Showing 13 changed files with 129 additions and 116 deletions.
6 changes: 3 additions & 3 deletions go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ this project. The `*.pb.go` files contain helper functions and structs that will
2. Clone this project.
3. Run `go mod vendor` from the `go` directory to fetch dependencies.
- NOTE: At this time the `vendor` directory has not been committed to this repo so you need to manually run the `go mod vendor` command to fetch dependencies. If the `vendor` directory is committed to the repo in the future, this step can be skipped.
4. Use a Salesforce org that's enabled for the pilot. Get the username, password, and login URL.
4. Use a Salesforce org. Get the username, password, and login URL.
5. Create a custom CarMaintenance [platform event](https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/platform_events_define_ui.htm) in your Salesforce org. Ensure your CarMaintenance platform event matches the following structure:
- Standard Fields
- Label: CarMaintenance
Expand All @@ -41,7 +41,7 @@ Pub/Sub API allows clients using the `Subscribe` RPC to specify one of the follo
* `CUSTOM`
* `EARLIEST`

For a description of these replay options, refer to the "Replaying an Event Stream" section in [Pub/Sub API (Pilot)](https://resources.docs.salesforce.com/rel1/doc/en-us/static/pdf/Salesforce_Pub_Sub_API_Pilot.pdf).
For a description of these replay options, refer to the "Replaying an Event Stream" section in the [Pub/Sub API docs](https://developer.salesforce.com/docs/platform/pub-sub-api/references/methods/subscribe-rpc.html#replaying-an-event-stream).

The subscribe example in this repo is compatible with all three options outlined above. To set a subscription option, update the `ReplayPreset` and `ReplayId` options in the `common.go` file. See the following examples:
* `LATEST`
Expand All @@ -60,7 +60,7 @@ The subscribe example in this repo is compatible with all three options outlined
1. Install protoc, protoc-gen-go, and protoc-gen-go-grpc and ensure the binaries are available in your PATH. See the [gRPC quick start docs](https://grpc.io/docs/languages/go/quickstart/#prerequisites) for more info.

## Generating the *.pb.go Files
1. Fetch the most current [proto file](https://github.com/developerforce/pub-sub-api-pilot/blob/main/pubsub_api.proto) and copy it to your own project.
1. Fetch the most current [proto file](https://github.com/developerforce/pub-sub-api/blob/main/pubsub_api.proto) and copy it to your own project.
2. Modify the `option go_package` line to match your desired import path.
3. Generate the Go files from the proto file with the `protoc` command. As an example, if you copied the proto file to `proto/pubsub_api.proto` then you can generate the `*.pb.go` files by running the following command from the root of your project:
```bash
Expand Down
4 changes: 2 additions & 2 deletions go/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package common
import (
"time"

"github.com/developerforce/pub-sub-api-pilot/go/proto"
"github.com/developerforce/pub-sub-api/go/proto"
)

var (
Expand All @@ -14,7 +14,7 @@ var (
Appetite int32 = 5

// gRPC server variables
GRPCEndpoint = "api.pilot.pubsub.salesforce.com:7443"
GRPCEndpoint = "api.pubsub.salesforce.com:7443"
GRPCDialTimeout = 5 * time.Second
GRPCCallTimeout = 5 * time.Second

Expand Down
4 changes: 2 additions & 2 deletions go/examples/publish/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main
import (
"log"

"github.com/developerforce/pub-sub-api-pilot/go/common"
"github.com/developerforce/pub-sub-api-pilot/go/grpcclient"
"github.com/developerforce/pub-sub-api/go/common"
"github.com/developerforce/pub-sub-api/go/grpcclient"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions go/examples/publishStream/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main
import (
"log"

"github.com/developerforce/pub-sub-api-pilot/go/common"
"github.com/developerforce/pub-sub-api-pilot/go/grpcclient"
"github.com/developerforce/pub-sub-api/go/common"
"github.com/developerforce/pub-sub-api/go/grpcclient"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion go/examples/schema/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"log"

"github.com/developerforce/pub-sub-api-pilot/go/grpcclient"
"github.com/developerforce/pub-sub-api/go/grpcclient"
)

func main() {
Expand Down
6 changes: 3 additions & 3 deletions go/examples/subscribe/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package main
import (
"log"

"github.com/developerforce/pub-sub-api-pilot/go/common"
"github.com/developerforce/pub-sub-api-pilot/go/grpcclient"
"github.com/developerforce/pub-sub-api-pilot/go/proto"
"github.com/developerforce/pub-sub-api/go/common"
"github.com/developerforce/pub-sub-api/go/grpcclient"
"github.com/developerforce/pub-sub-api/go/proto"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion go/examples/topic/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"log"

"github.com/developerforce/pub-sub-api-pilot/go/grpcclient"
"github.com/developerforce/pub-sub-api/go/grpcclient"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion go/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/developerforce/pub-sub-api-pilot/go
module github.com/developerforce/pub-sub-api/go

go 1.18

Expand Down
6 changes: 3 additions & 3 deletions go/grpcclient/grpcclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"sync"
"time"

"github.com/developerforce/pub-sub-api-pilot/go/common"
"github.com/developerforce/pub-sub-api-pilot/go/oauth"
"github.com/developerforce/pub-sub-api-pilot/go/proto"
"github.com/developerforce/pub-sub-api/go/common"
"github.com/developerforce/pub-sub-api/go/oauth"
"github.com/developerforce/pub-sub-api/go/proto"
"github.com/linkedin/goavro/v2"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
Expand Down
2 changes: 1 addition & 1 deletion go/oauth/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/url"
"strings"

"github.com/developerforce/pub-sub-api-pilot/go/common"
"github.com/developerforce/pub-sub-api/go/common"
)

const (
Expand Down
Loading

0 comments on commit 2c38034

Please sign in to comment.