This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This toy example explains how you can use dependency inversion and | |
interface segregation in Go. It allows your code to remain flexible, | |
unit testable, and better protected from upstream changes. In the | |
last case, if a library author decides to break their own code in | |
ways that do not fit your design, you have the opportunity to | |
impelement the interface yourself or simply wrap their code in a way | |
that suites you, all while not having to change a single line in your | |
existing code that depends on it since you own the interface. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"strings" | |
) | |
// consoleOptions is a private structure that contains | |
// the possible options for a Console. It's private so | |
// that consumers do not rely on its members. This allows |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:timestamp=>"2016-09-09T22:01:49.624000+0000", :message=>"Pipeline aborted due to error", :exception=>"LogStash::ConfigurationError", :backtrace=>["/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-kafka-2.0.9/lib/logstash/inputs/kafka.rb:129:in `register'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:330:in `start_inputs'", "org/jruby/RubyArray.java:1613:in `each'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:329:in `start_inputs'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:180:in `start_workers'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:136:in `run'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/agent.rb:491:in `start_pipeline'"], :level=>:error} | |
{:timestamp=>"2016-09-09T22:01:52.629000+0000", :message=>"stopping pipeline", :id=>"main"} | |
{:timestamp=>"2016-09-0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Install landrush if it's not installed. This bash script is saved | |
# into a Ruby var. Landrush allows the nodes to reference each other | |
# by hostname. | |
check_landrush = <<CHECK_LANDRUSH | |
#!/bin/bash | |
plugins="$(vagrant plugin list)" |