Bring Go client to functional parity of cli
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 17k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 105
Description
Proposal
As per documentation pages the method to stream a specific file from allocation has multiple options, such as path, follow, offset and origin. Same options are available via both REST API and nomad operator api .... However Go client Client.AllocFs().Stream() accepts all of those except follow, it currently uses follow=true which there is no way to override.
Use-cases
- Retrieving single file that is not being written to
- Retrieving "point-in-time" of single file that is being actively written
Attempted Solutions
- Looked at using
.Raw()but it requires way more coding around than I would like to. - There is a
.Cat()method, that does actually work asfollow=false, but this is different from the Logs functionality where the same method is used for both using boolean argument as a switch.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in api/fs.go around the AllocFs().Stream() method and compare its arguments with the stream-file API documentation and the equivalent nomad operator api behavior. Confirm how follow is represented in the Go client, then verify that callers can retrieve both a complete file and a point-in-time snapshot without using Raw().
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100