Commit 15f850f0 authored by Brian Tiger Chow's avatar Brian Tiger Chow

refactor(2/main) helper methods for details object

License: MIT
Signed-off-by: default avatarBrian Tiger Chow <brian@perfmode.com>
parent 60af68bb
......@@ -77,6 +77,7 @@ func (d *cmdDetails) String() string {
}
func (d *cmdDetails) usesConfigAsInput() bool { return !d.doesNotUseConfigAsInput }
func (d *cmdDetails) doesNotPreemptAutoUpdate() bool { return !d.preemptsAutoUpdate }
func (d *cmdDetails) canRunOnClient() bool { return !d.cannotRunOnClient }
func (d *cmdDetails) canRunOnDaemon() bool { return !d.cannotRunOnDaemon }
func (d *cmdDetails) usesRepo() bool { return !d.doesNotUseRepo }
......
......@@ -219,7 +219,7 @@ func callPreCommandHooks(details cmdDetails, req cmds.Request, root *cmds.Comman
// check for updates when 1) commands is going to be run locally, 2) the
// command does not initialize the config, and 3) the command does not
// pre-empt updates
if !daemon && details.usesConfigAsInput() && !details.preemptsAutoUpdate {
if !daemon && details.usesConfigAsInput() && details.doesNotPreemptAutoUpdate() {
log.Debug("Calling hook: Check for updates")
......@@ -328,7 +328,6 @@ func commandDetails(path []string, root *cmds.Command) (*cmdDetails, error) {
details = cmdDetails
}
}
log.Debugf("cmd perms for +%v: %s", path, details.String())
return &details, nil
}
......
......@@ -16,8 +16,8 @@ type Loggable interface {
Loggable() map[string]interface{}
}
// UniqueEvent returns a Metadata with the string key and UUID value
func UniqueEvent(key string) Metadata {
// Uuid returns a Metadata with the string key and UUID value
func Uuid(key string) Metadata {
return Metadata{
key: uuid.New(),
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment