github.com/mackerelio/mackerel-agent-plugins@v0.89.3/mackerel-plugin-unicorn/lib/piped_commands.go (about)

     1  package mpunicorn
     2  
     3  import "github.com/mattn/go-pipeline"
     4  
     5  // PipedCommands interface
     6  type PipedCommands interface {
     7  	Output(...[]string) ([]byte, error)
     8  }
     9  
    10  // RealPipedCommands struct
    11  type RealPipedCommands struct{}
    12  
    13  var pipedCommands PipedCommands
    14  
    15  // Output for RealPipedCommands
    16  func (r RealPipedCommands) Output(commands ...[]string) ([]byte, error) {
    17  	out, err := pipeline.Output(commands...)
    18  	return out, err
    19  }