Skip to content

Commit

Permalink
Remove old listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
adriacidre committed Mar 1, 2017
1 parent 07baae1 commit 8f3e914
Show file tree
Hide file tree
Showing 13 changed files with 0 additions and 464 deletions.
19 changes: 0 additions & 19 deletions c_bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,13 @@ type Bootstrap struct {
// Handle : ..
func (n *Bootstrap) Handle(subject string, components []interface{}, lines []Message) []Message {
switch subject {
case "bootstraps.create":
lines = append(lines, Message{Body: "Running bootstraps:", Level: "INFO"})
case "bootstraps.create.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "Bootstrap ran", Level: "INFO"})
case "bootstraps.create.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "Bootstrap failed", Level: "INFO"})

case "bootstrap.create.done", "bootstrap.create.error":
lines = n.getSingleDetail(components, "Bootstrap ran")
}

return lines
}

func (n *Bootstrap) getDetails(components []interface{}) (lines []Message) {
for _, v := range components {
for _, l := range n.getSingleDetail(v, "") {
lines = append(lines, l)
}
}

return lines
}

func (n *Bootstrap) getSingleDetail(v interface{}, prefix string) (lines []Message) {
r := v.(map[string]interface{})
name, _ := r["name"].(string)
Expand Down
34 changes: 0 additions & 34 deletions c_ebs_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,6 @@ type EBSVolume struct {
// Handle : ...
func (n *EBSVolume) Handle(subject string, components []interface{}, lines []Message) []Message {
switch subject {
case "ebs_volumes.create":
return append(lines, Message{Body: "Creating ebs volumes:", Level: "INFO"})
case "ebs_volumes.create.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "EBS volumes successfully created", Level: "INFO"})
case "ebs_volumes.create.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "EBS volumes creation failed", Level: "INFO"})
case "ebs_volumes.delete":
return append(lines, Message{Body: "Deleting ebs volumes:", Level: "INFO"})
case "ebs_volumes.delete.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "EBS volumes deleted", Level: "INFO"})
case "ebs_volumes.delete.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "EBS volumes deletion failed", Level: "INFO"})
case "ebs_volumes.find":
return append(lines, Message{Body: "Importing ebs volumes:", Level: "INFO"})
case "ebs_volumes.find.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "EBS volumes successfully imported", Level: "INFO"})
case "ebs_volumes.find.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "EBS volumes import failed", Level: "INFO"})

case "ebs_volume.create.done", "ebs_volume.create.error":
lines = n.getSingleDetail(components, "Created EBS volume ")
case "ebs_volume.delete.done", "ebs_volume.delete.error":
Expand All @@ -46,15 +21,6 @@ func (n *EBSVolume) Handle(subject string, components []interface{}, lines []Mes
return lines
}

func (n *EBSVolume) getDetails(components []interface{}) (lines []Message) {
for _, v := range components {
for _, l := range n.getSingleDetail(v, "") {
lines = append(lines, l)
}
}
return lines
}

func (n *EBSVolume) getSingleDetail(v interface{}, prefix string) (lines []Message) {
r := v.(map[string]interface{})
name, _ := r["name"].(string)
Expand Down
43 changes: 0 additions & 43 deletions c_elb.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,6 @@ type ELB struct {
// Handle : ...
func (n *ELB) Handle(subject string, components []interface{}, lines []Message) []Message {
switch subject {
case "elbs.create":
lines = append(lines, Message{Body: "Creating ELBs:", Level: "INFO"})
case "elbs.create.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "ELBs created", Level: "INFO"})
case "elbs.create.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "ELBs creation failed", Level: "INFO"})
case "elbs.update":
return append(lines, Message{Body: "Updating ELBs:", Level: "INFO"})
case "elbs.update.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "ELBs updated", Level: "INFO"})
case "elbs.update.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "ELBs modification failed", Level: "INFO"})
case "elbs.delete":
return append(lines, Message{Body: "Deleting ELBs:", Level: "INFO"})
case "elbs.delete.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "ELBs deleted", Level: "INFO"})
case "elbs.delete.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "ELBs deletion failed", Level: "INFO"})
case "elbs.find":
lines = append(lines, Message{Body: "Importing ELBs:", Level: "INFO"})
case "elbs.find.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "ELBs imported", Level: "INFO"})
case "elbs.find.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "ELBs import failed", Level: "INFO"})

case "elb.create.done", "elb.create.error":
lines = n.getSingleDetail(components, "Created ELB")
case "elb.update.done", "elb.update.error":
Expand All @@ -57,16 +24,6 @@ func (n *ELB) Handle(subject string, components []interface{}, lines []Message)
return lines
}

func (n *ELB) getDetails(components []interface{}) (lines []Message) {
for _, v := range components {
for _, l := range n.getSingleDetail(v, "") {
lines = append(lines, l)
}
}

return lines
}

func (n *ELB) getSingleDetail(v interface{}, prefix string) (lines []Message) {
r := v.(map[string]interface{})
name, _ := r["name"].(string)
Expand Down
19 changes: 0 additions & 19 deletions c_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,12 @@ type Execution struct {
// Handle : ...
func (n *Execution) Handle(subject string, components []interface{}, lines []Message) []Message {
switch subject {
case "executions.create":
lines = append(lines, Message{Body: "Running executions:", Level: "INFO"})
case "executions.create.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "Executions ran", Level: "INFO"})
case "executions.create.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "Executions failed", Level: "INFO"})

case "execution.create.done", "execution.create.error":
lines = n.getSingleDetail(components, "Ran execution")
}
return lines
}

func (n *Execution) getDetails(components []interface{}) (lines []Message) {
for _, v := range components {
for _, l := range n.getSingleDetail(v, "") {
lines = append(lines, l)
}
}

return lines
}

func (n *Execution) getSingleDetail(v interface{}, prefix string) (lines []Message) {
r := v.(map[string]interface{})
name, _ := r["name"].(string)
Expand Down
43 changes: 0 additions & 43 deletions c_firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,6 @@ type Firewall struct {
// Handle : ...
func (n *Firewall) Handle(subject string, components []interface{}, lines []Message) []Message {
switch subject {
case "firewalls.create":
lines = append(lines, Message{Body: "Creating firewalls:", Level: "INFO"})
case "firewalls.create.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "Firewalls created", Level: "INFO"})
case "firewalls.create.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "Firewalls creation failed", Level: "INFO"})
case "firewalls.update":
return append(lines, Message{Body: "Updating firewalls:", Level: "INFO"})
case "firewalls.update.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "Firewalls updated", Level: "INFO"})
case "firewalls.update.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "Firewalls modification failed", Level: "INFO"})
case "firewalls.delete":
return append(lines, Message{Body: "Deleting firewalls:", Level: "INFO"})
case "firewalls.delete.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "Firewalls deleted", Level: "INFO"})
case "firewalls.delete.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "Firewalls deletion failed", Level: "INFO"})
case "firewalls.find":
lines = append(lines, Message{Body: "Importing firewalls:", Level: "INFO"})
case "firewalls.find.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "Firewalls imported", Level: "INFO"})
case "firewalls.find.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "Firewalls import failed", Level: "INFO"})

case "firewall.create.done", "firewall.create.error":
lines = n.getSingleDetail(components, "Firewall created")
case "firewall.update.done", "firewall.update.error":
Expand All @@ -56,16 +23,6 @@ func (n *Firewall) Handle(subject string, components []interface{}, lines []Mess
return lines
}

func (n *Firewall) getDetails(components []interface{}) (lines []Message) {
for _, v := range components {
for _, l := range n.getSingleDetail(v, "") {
lines = append(lines, l)
}
}

return lines
}

func (n *Firewall) getSingleDetail(v interface{}, prefix string) (lines []Message) {
r := v.(map[string]interface{})
name, _ := r["name"].(string)
Expand Down
43 changes: 0 additions & 43 deletions c_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,6 @@ type Instance struct {
// Handle : ...
func (n *Instance) Handle(subject string, components []interface{}, lines []Message) []Message {
switch subject {
case "instances.create":
lines = append(lines, Message{Body: "Creating instances:", Level: "INFO"})
case "instances.create.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "Instances successfully created", Level: "INFO"})
case "instances.create.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "Instances creation failed", Level: "INFO"})
case "instances.update":
return append(lines, Message{Body: "Updating instances:", Level: "INFO"})
case "instances.update.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "Instances successfully updated", Level: "INFO"})
case "instances.update.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "Instances modification failed", Level: "INFO"})
case "instances.delete":
return append(lines, Message{Body: "Deleting instances:", Level: "INFO"})
case "instances.delete.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "Instances deleted", Level: "INFO"})
case "instances.delete.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "Instances deletion failed", Level: "INFO"})
case "instances.find":
lines = append(lines, Message{Body: "Importing instances:", Level: "INFO"})
case "instances.find.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "Instances successfully imported", Level: "INFO"})
case "instances.find.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "Instances import failed", Level: "INFO"})

case "instance.create.done", "instance.create.error":
lines = n.getSingleDetail(components, "Instance created")
case "instance.update.done", "instance.update.error":
Expand All @@ -56,16 +23,6 @@ func (n *Instance) Handle(subject string, components []interface{}, lines []Mess
return lines
}

func (n *Instance) getDetails(components []interface{}) (lines []Message) {
for _, v := range components {
for _, l := range n.getSingleDetail(v, "") {
lines = append(lines, l)
}
}

return lines
}

func (n *Instance) getSingleDetail(v interface{}, prefix string) (lines []Message) {
r := v.(map[string]interface{})
ip, _ := r["ip"].(string)
Expand Down
43 changes: 0 additions & 43 deletions c_nat.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,6 @@ type Nat struct {
// Handle : ...
func (n *Nat) Handle(subject string, components []interface{}, lines []Message) []Message {
switch subject {
case "nats.create":
lines = append(lines, Message{Body: "Creating nats:", Level: "INFO"})
case "nats.create.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "Nats created", Level: "INFO"})
case "nats.create.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "Nats creation failed", Level: "INFO"})
case "nats.update":
return append(lines, Message{Body: "Updating nats:", Level: "INFO"})
case "nats.update.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "Nats updated", Level: "INFO"})
case "nats.update.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "Nats modification failed", Level: "INFO"})
case "nats.delete":
return append(lines, Message{Body: "Deleting nats:", Level: "INFO"})
case "nats.delete.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "Nats deleted", Level: "INFO"})
case "nats.delete.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "Nats deletion failed", Level: "INFO"})
case "nats.find":
lines = append(lines, Message{Body: "Importing nats:", Level: "INFO"})
case "nats.find.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "Nats imported", Level: "INFO"})
case "nats.find.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "Nats import failed", Level: "INFO"})

case "nat.create.done", "nat.create.error":
lines = n.getSingleDetail(components, "Nat created")
case "nat.update.done", "nat.update.error":
Expand All @@ -56,16 +23,6 @@ func (n *Nat) Handle(subject string, components []interface{}, lines []Message)
return lines
}

func (n *Nat) getDetails(components []interface{}) (lines []Message) {
for _, v := range components {
for _, l := range n.getSingleDetail(v, "") {
lines = append(lines, l)
}
}

return lines
}

func (n *Nat) getSingleDetail(v interface{}, prefix string) (lines []Message) {
r := v.(map[string]interface{})
name, _ := r["name"].(string)
Expand Down
34 changes: 0 additions & 34 deletions c_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,6 @@ type Network struct {
// Handle : ...
func (n *Network) Handle(subject string, components []interface{}, lines []Message) []Message {
switch subject {
case "networks.create":
return append(lines, Message{Body: "Creating networks:", Level: "INFO"})
case "networks.create.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "Networks successfully created", Level: "INFO"})
case "networks.create.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "Networks creation failed", Level: "INFO"})
case "networks.delete":
return append(lines, Message{Body: "Deleting networks:", Level: "INFO"})
case "networks.delete.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "Networks deleted", Level: "INFO"})
case "networks.delete.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "Networks deletion failed", Level: "INFO"})
case "networks.find":
return append(lines, Message{Body: "Importing networks:", Level: "INFO"})
case "networks.find.done":
lines = n.getDetails(components)
return append(lines, Message{Body: "Networks successfully imported", Level: "INFO"})
case "networks.find.error":
lines = n.getDetails(components)
return append(lines, Message{Body: "Networks import failed", Level: "INFO"})

case "network.create.done", "network.create.error":
lines = n.getSingleDetail(components, "Network created")
case "network.delete.done", "network.delete.error":
Expand All @@ -46,15 +21,6 @@ func (n *Network) Handle(subject string, components []interface{}, lines []Messa
return lines
}

func (n *Network) getDetails(components []interface{}) (lines []Message) {
for _, v := range components {
for _, l := range n.getSingleDetail(v, "") {
lines = append(lines, l)
}
}
return lines
}

func (n *Network) getSingleDetail(v interface{}, prefix string) (lines []Message) {
r := v.(map[string]interface{})
ip, _ := r["range"].(string)
Expand Down
Loading

0 comments on commit 8f3e914

Please sign in to comment.