Skip to content

Commit

Permalink
Merge pull request #201 from Scalingo/fix/GRR-39/deployment_stream
Browse files Browse the repository at this point in the history
fix: rename 'DeployEvent*' structures to 'DeploymentEvent*'
  • Loading branch information
john-scalingo authored Feb 16, 2021
2 parents b62e711 + f4d128e commit c91e126
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## To Be Released

* Rename `DeployEvent*` structures to `DeploymentEvent*` [#201](https://github.com/Scalingo/go-scalingo/pull/201)

## 4.11.0

* Add `DeployEvent` structure which represents a deployment stream event sent on the websocket [#200](https://github.com/Scalingo/go-scalingo/pull/200)
Expand Down
32 changes: 16 additions & 16 deletions deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,32 +50,32 @@ type Deployment struct {
Links *DeploymentLinks `json:"links"`
}

// DeploymentEventStatus holds all different deployment stream types of event.
type DeploymentEventStatus string
// DeploymentEventType holds all different deployment stream types of event.
type DeploymentEventType string

const (
EventPing DeploymentEventStatus = "ping"
EventNew DeploymentEventStatus = "new"
EventLog DeploymentEventStatus = "log"
EventStatus DeploymentEventStatus = "status"
DeploymentEventTypePing DeploymentEventType = "ping"
DeploymentEventTypeNew DeploymentEventType = "new"
DeploymentEventTypeLog DeploymentEventType = "log"
DeploymentEventTypeStatus DeploymentEventType = "status"
)

// DeployEvent represents a deployment stream event sent on the websocket.
type DeployEvent struct {
// DeploymentEvent represents a deployment stream event sent on the websocket.
type DeploymentEvent struct {
// ID of the deployment which this event belongs to
ID string `json:"id"`
Type DeploymentEventStatus `json:"type"`
Data json.RawMessage `json:"data"`
ID string `json:"id"`
Type DeploymentEventType `json:"type"`
Data json.RawMessage `json:"data"`
}

// DeployEventDataLog is the data type present in the DeployEvent.Data field if the DeployEvent.Type is EventLog
type DeployEventDataLog struct {
// DeploymentEventDataLog is the data type present in the DeploymentEvent.Data field if the DeploymentEvent.Type is DeploymentEventDataLog
type DeploymentEventDataLog struct {
Content string `json:"content"`
}

// DeployEventDataStatus is the data type present in the DeployEvent.Data field if the DeployEvent.Type is EventStatus
type DeployEventDataStatus struct {
Status string `json:"Status"`
// DeploymentEventDataStatus is the data type present in the DeploymentEvent.Data field if the DeploymentEvent.Type is DeploymentEventDataStatus
type DeploymentEventDataStatus struct {
Status DeploymentStatus `json:"status"`
}

type DeploymentsCreateParams struct {
Expand Down

0 comments on commit c91e126

Please sign in to comment.