dapr / dapr/components-contrib
Cross-platform temp directory for local storage binding
- Dominant language
- Go
- Stars
- 602
- Forks
- 580
- Avg merge
- 4d 9h
- Merged PRs (30d)
- 6
Description
The local storage binding is very useful in development scenarios where a cloud storage solution would be cumbersome.
In these development scenarios, you may want to use the system temp directory.
However, there is currently no way to do this is in a cross-platform way.
The local storage component currently has a single "rootPath" metadata.
To use the temp directory on Unix-based systems, rootPath can be set to "/tmp".
On Windows, either the system-wide temp directory (C:\Windows\Temp) or the user-specific temp directory (C:\Users\\AppData\Local\Temp) can be used.
This may be a problem when sharing development environments between systems, especially in multi-app run scenarios.
To solve this, I'd like to suggest either adding a "fromTemp" boolean metadata that resolves rootPath from the system-wide tmp dir if true, and defaults to false (so as not to break any current deployments), or allowing the expansion of env variables in rootpath before creating the directory (but this may lead to unexpected behavior)
Contributor guide
Research direction
Start by locating the local storage binding and the code that handles its rootPath metadata. Review how paths and directories are created on Unix-based systems and Windows, then confirm which proposed behavior maintainers want; done means a cross-platform temp-directory option works without changing existing rootPath deployments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100