mirror of
https://github.com/kemko/nomad.git
synced 2026-01-08 19:35:41 +03:00
Replace logging and config with DriverContext, which allows us to expand the dependency injection without changing the interface
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -21,8 +20,7 @@ import (
|
||||
// JavaDriver is a simple driver to execute applications packaged in Jars.
|
||||
// It literally just fork/execs tasks with the java command.
|
||||
type JavaDriver struct {
|
||||
logger *log.Logger
|
||||
config *config.Config
|
||||
DriverContext
|
||||
}
|
||||
|
||||
// javaHandle is returned from Start/Open as a handle to the PID
|
||||
@@ -33,12 +31,8 @@ type javaHandle struct {
|
||||
}
|
||||
|
||||
// NewJavaDriver is used to create a new exec driver
|
||||
func NewJavaDriver(logger *log.Logger, config *config.Config) Driver {
|
||||
d := &JavaDriver{
|
||||
logger: logger,
|
||||
config: config,
|
||||
}
|
||||
return d
|
||||
func NewJavaDriver(ctx *DriverContext) Driver {
|
||||
return &JavaDriver{*ctx}
|
||||
}
|
||||
|
||||
func (d *JavaDriver) Fingerprint(cfg *config.Config, node *structs.Node) (bool, error) {
|
||||
|
||||
Reference in New Issue
Block a user