parse ntg jobs and strigify them

This commit is contained in:
Bel LaPointe
2022-01-09 21:56:01 -05:00
parent bf3c382877
commit ad9af0a5db
7 changed files with 236 additions and 2 deletions

22
broker/ntgvision_mock.go Normal file
View File

@@ -0,0 +1,22 @@
package broker
import (
"bytes"
"io"
"io/ioutil"
"local/truckstop/config"
"os"
"path"
)
type NTGVisionMock struct{}
func NewNTGVisionMock() NTGVisionMock {
return NTGVisionMock{}
}
func (ntgm NTGVisionMock) search(states []config.State) (io.ReadCloser, error) {
path := path.Join(os.Getenv("GOPATH"), "src", "local", "truckstop", "broker", "testdata", "ntgvision_response.json")
b, err := ioutil.ReadFile(path)
return io.NopCloser(bytes.NewReader(b)), err
}