Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: rename 'DeployEvent*' structures to 'DeploymentEvent*' #201

Merged
merged 4 commits into from
Feb 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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