-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add feature to switch pages thorugh prompt
- Add config params to hold active view, profile and region - Fix viewing flash msg under crumbs
- Loading branch information
1 parent
4fdaaa3
commit 599a765
Showing
15 changed files
with
1,138 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package config | ||
|
||
type Active struct { | ||
Profile string `yaml:"profile"` | ||
Region string `yaml:"region"` | ||
View string `yaml:"view"` | ||
} | ||
|
||
type Cloudlens struct { | ||
EnableMouse bool `yaml:"enableMouse"` | ||
Headless bool `yaml:"headless"` | ||
Logoless bool `yaml:"logoless"` | ||
Crumbsless bool `yaml:"crumbsless"` | ||
Active *Active `yaml:"active"` | ||
} | ||
|
||
// NewCloudlens create a new Cloudlens configuration. | ||
func NewCloudlens() *Cloudlens { | ||
return &Cloudlens{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package config | ||
|
||
import ( | ||
"os" | ||
"path/filepath" | ||
|
||
"github.com/rs/zerolog/log" | ||
) | ||
|
||
const ( | ||
// DefaultDirMod default unix perms for k9s directory. | ||
DefaultDirMod os.FileMode = 0755 | ||
// DefaultFileMod default unix perms for k9s files. | ||
DefaultFileMod os.FileMode = 0600 | ||
) | ||
|
||
// EnsurePath ensures a directory exist from the given path. | ||
func EnsurePath(path string, mod os.FileMode) { | ||
dir := filepath.Dir(path) | ||
EnsureFullPath(dir, mod) | ||
} | ||
|
||
// EnsureFullPath ensures a directory exist from the given path. | ||
func EnsureFullPath(path string, mod os.FileMode) { | ||
if _, err := os.Stat(path); os.IsNotExist(err) { | ||
if err = os.MkdirAll(path, mod); err != nil { | ||
log.Fatal().Msgf("Unable to create dir %q %v", path, err) | ||
} | ||
} | ||
} |
Oops, something went wrong.