Skip to content

Commit 4ab5b49

Browse files
author
Praveenrajmani
committed
new structure
1 parent 7e0d951 commit 4ab5b49

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

event/api.go

+17-3
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,40 @@ package event
1919

2020
import "time"
2121

22+
// Origin for the API event
23+
type Origin string
24+
25+
const (
26+
OriginClient Origin = "client"
27+
OriginSiteReplication Origin = "site-replication"
28+
OriginILM Origin = "ilm"
29+
OriginBatch Origin = "batch"
30+
OriginRebalance Origin = "rebalance"
31+
OriginReplicate Origin = "replicate"
32+
OriginDecommission Origin = "decommission"
33+
OriginHeal Origin = "heal"
34+
)
35+
2236
// API represents the api event
2337
type API struct {
2438
Version string `json:"version"`
25-
Type string `json:"type,omitempty"`
2639
DeploymentID string `json:"deploymentid,omitempty"`
2740
SiteName string `json:"siteName,omitempty"`
2841
Time time.Time `json:"time"`
2942
Node string `json:"node,omitempty"`
43+
Origin Origin `json:"origin,omitempty"`
44+
Type string `json:"type,omitempty"`
3045
Name string `json:"name,omitempty"`
3146
Bucket string `json:"bucket,omitempty"`
3247
Object string `json:"object,omitempty"`
3348
VersionID string `json:"versionId,omitempty"`
34-
External bool `json:"external,omitempty"`
3549
Tags map[string]interface{} `json:"tags,omitempty"`
3650
CallInfo *CallInfo `json:"callInfo,omitempty"`
3751
}
3852

3953
// CallInfo represents the info for the external call
4054
type CallInfo struct {
41-
StatusCode int `json:"statusCode,omitempty"`
55+
HttpStatusCode int `json:"httpStatusCode,omitempty"`
4256
InputBytes int64 `json:"rx"`
4357
OutputBytes int64 `json:"tx"`
4458
HeaderBytes int64 `json:"txHeaders,omitempty"`

0 commit comments

Comments
 (0)