-
Notifications
You must be signed in to change notification settings - Fork 43
chore: extract constants package #282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package constants | ||
|
||
import ( | ||
"errors" | ||
"path/filepath" | ||
) | ||
|
||
const ( | ||
// WorkspacesDir is the path to the directory where | ||
// all workspaces are stored by default. | ||
WorkspacesDir = "/workspaces" | ||
|
||
// EmptyWorkspaceDir is the path to a workspace that has | ||
// nothing going on... it's empty! | ||
EmptyWorkspaceDir = WorkspacesDir + "/empty" | ||
|
||
// MagicDir is where all envbuilder related files are stored. | ||
// This is a special directory that must not be modified | ||
// by the user or images. | ||
MagicDir = "/.envbuilder" | ||
) | ||
|
||
var ( | ||
ErrNoFallbackImage = errors.New("no fallback image has been specified") | ||
|
||
// MagicFile is a file that is created in the workspace | ||
// when envbuilder has already been run. This is used | ||
// to skip building when a container is restarting. | ||
// e.g. docker stop -> docker start | ||
MagicFile = filepath.Join(MagicDir, "built") | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do feel like this and options belong in the same package, how about merging them under I suppose a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two alternatives,
config
anddefaults
. Not sure if/which would be better.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally dislike both of those options 😅 but I don't have a better proposal.