Skip to content

Conversation

@evalphobia
Copy link

@evalphobia evalphobia commented Dec 24, 2019

This PR adds a new fetcher.
The fetcher can contain multiple other fetchers and execute and retrieve results from them.

// example usage
overseer.Run(overseer.Config{
	Program: prog,
	Fetcher:  &fetcher.Multiple{
		List: []fetcher.Interface{
			&fetcher.File{
				Path: "/path/to/my_app",
			},
			&fetcher.Github{
				User: "jpillora",
				Repo: "overseer",
			},
			// add other fetchers...
	},
})


result chan fetchResult
runningStatusMu sync.RWMutex
runningStatus map[int]bool
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

result is channel type because used for retrieving the single fastest results from fetchers.
To avoid duplicate goroutine running, runningStatus is used for managing fetchers' running state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant