Skip to content

Commit

Permalink
fix(event bus): encoded fields use lower-case names in JSON
Browse files Browse the repository at this point in the history
to keep over-the-wire coding consistent, use lowerCaseFieldNames for any struct that's being sent as an event & piped over a websocket.
  • Loading branch information
b5 committed Oct 1, 2020
1 parent 47bb395 commit a14f28f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
16 changes: 8 additions & 8 deletions event/dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ const (

// DsChange represents the result of a change to a dataset
type DsChange struct {
InitID string
TopIndex int
ProfileID string
Username string
PrettyName string
HeadRef string
Info *dsref.VersionInfo
Dir string
InitID string `json:"initID"`
TopIndex int `json:"topIndex"`
ProfileID string `json:"profileID"`
Username string `json:"username"`
PrettyName string `json:"prettyName"`
HeadRef string `json:"headRef"`
Info *dsref.VersionInfo `json:"info"`
Dir string `json:"dir"`
}
16 changes: 8 additions & 8 deletions event/filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ const (

// FSICreateLinkEvent describes an FSI created link
type FSICreateLinkEvent struct {
FSIPath string
Username string
Dsname string
FSIPath string `json:"fsiPath"`
Username string `json:"username"`
Dsname string `json:"dsName"`
}

const (
Expand All @@ -32,9 +32,9 @@ const (

// WatchfsChange represents events for filesystem changes
type WatchfsChange struct {
Username string
Dsname string
Source string
Destination string
Time time.Time
Username string `json:"username"`
Dsname string `json:"dsName"`
Source string `json:"source"`
Destination string `json:"destination"`
Time time.Time `json:"time"`
}
6 changes: 3 additions & 3 deletions event/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const (

// RemoteEvent encapsulates the push / pull progress of a dataset version
type RemoteEvent struct {
Ref dsref.Ref
RemoteAddr string
Progress dag.Completion
Ref dsref.Ref `json:"ref"`
RemoteAddr string `json:"remoteAddr"`
Progress dag.Completion `json:"progress"`
}

0 comments on commit a14f28f

Please sign in to comment.