-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(plugin): first iteration plugin manager (#71)
* feat(plugin): first iteration plugin manager
- Loading branch information
Stan Girard
authored
Sep 8, 2022
1 parent
97cef4a
commit 378b0e1
Showing
185 changed files
with
228 additions
and
11,519 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 |
---|---|---|
@@ -1,26 +1,21 @@ | ||
package yatas | ||
|
||
import ( | ||
"github.com/vbauerster/mpb/v7" | ||
"github.com/vbauerster/mpb/v7/decor" | ||
) | ||
// func (c *Config) AddBar(description, id string, value, priority int, p *mpb.Progress) { | ||
// if c.PluginsProgress == nil { | ||
// c.PluginsProgress = make(map[string]Progress) | ||
// } | ||
// c.PluginsProgress[id] = Progress{ | ||
// Bar: p.AddBar(int64(value), | ||
// mpb.PrependDecorators( | ||
// decor.Name(description), | ||
// decor.CountersNoUnit(" %d / %d"), | ||
// ), | ||
// mpb.AppendDecorators( | ||
// decor.Percentage(), | ||
// ), | ||
// ), | ||
// Value: value, | ||
// } | ||
// c.PluginsProgress[id].Bar.SetPriority(priority) | ||
|
||
func (c *Config) AddBar(description, id string, value, priority int, p *mpb.Progress) { | ||
if c.PluginsProgress == nil { | ||
c.PluginsProgress = make(map[string]Progress) | ||
} | ||
c.PluginsProgress[id] = Progress{ | ||
Bar: p.AddBar(int64(value), | ||
mpb.PrependDecorators( | ||
decor.Name(description), | ||
decor.CountersNoUnit(" %d / %d"), | ||
), | ||
mpb.AppendDecorators( | ||
decor.Percentage(), | ||
), | ||
), | ||
Value: value, | ||
} | ||
c.PluginsProgress[id].Bar.SetPriority(priority) | ||
|
||
} | ||
// } |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.