Skip to content

Instantly share code, notes, and snippets.

@kmacgugan
Created October 31, 2017 20:35
Show Gist options
  • Save kmacgugan/0b6a26d25a5a837acf65bf884530b5df to your computer and use it in GitHub Desktop.
Save kmacgugan/0b6a26d25a5a837acf65bf884530b5df to your computer and use it in GitHub Desktop.
In the converge-service you can use mocked data as the backend by passing in a config flag --elasticsearch or --mock
https://github.com/chef/converge-service/blob/master/cmd/converge-service/converge-service.go#L37
If mock is passed in the server starts the mock backend when starting up:
https://github.com/chef/converge-service/blob/master/cmd/converge-service/converge-service.go#L82
This sets up which backend the backend package interface is using.
Interface defined here:
https://github.com/chef/converge-service/blob/master/backend/client.go#L18
The mock functions are easily implemented to return static data:
https://github.com/chef/converge-service/blob/master/backend/mock/mock.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment