Skip to content

Commit ecc4269

Browse files
authored
Revert "feat(payload): add user_id to payload" (#4)
Signed-off-by: Niladri Halder <[email protected]>
1 parent 2277f89 commit ecc4269

File tree

3 files changed

+1
-14
lines changed

3 files changed

+1
-14
lines changed

client/client.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ func (c *MeasurementClient) Send(event *event.OpenebsEvent) error {
2929
dataPayload, err := payload.NewPayload(
3030
payload.WithClientId(client.clientId),
3131
payload.WithOpenebsEvent(event),
32-
payload.WithUserId(client.clientId),
3332
)
3433

3534
if err != nil {

example/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ func main() {
99
client, err := gaClient.NewMeasurementClient(
1010
gaClient.WithApiSecret("NguBiGh6QeOdeG3zJswggQ"),
1111
gaClient.WithMeasurementId("G-TZGP46618W"),
12-
gaClient.WithClientId("uniqueClientId-000000001"),
12+
gaClient.WithClientId("uniqueUserId-000000001"),
1313
)
1414
if err != nil {
1515
panic(err)

payload/build.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ type PayloadOption func(*Payload) error
1111
type Payload struct {
1212
ClientId string `json:"client_id"`
1313
Events []ApiEvent `json:"events"`
14-
UserId string `json:"user_id"`
1514
}
1615

1716
type ApiEvent struct {
@@ -44,17 +43,6 @@ func WithClientId(clientId string) PayloadOption {
4443
}
4544
}
4645

47-
func WithUserId(userId string) PayloadOption {
48-
return func(p *Payload) error {
49-
if len(userId) == 0 {
50-
return errors.Errorf("failed to set Payload userId: id is an empty string")
51-
}
52-
53-
p.UserId = userId
54-
return nil
55-
}
56-
}
57-
5846
func WithOpenebsEvent(event *event.OpenebsEvent) PayloadOption {
5947
return func(p *Payload) error {
6048
p.Events = append(p.Events, ApiEvent{

0 commit comments

Comments
 (0)