mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 10:46:57 -07:00
new: exporting module parameters current value in api.rest
This commit is contained in:
parent
ee8fe972e0
commit
0f427911be
2 changed files with 21 additions and 7 deletions
|
@ -99,17 +99,19 @@ func (env *Environment) Set(name, value string) string {
|
|||
return old
|
||||
}
|
||||
|
||||
func (env *Environment) Get(name string) (bool, string) {
|
||||
env.Lock()
|
||||
defer env.Unlock()
|
||||
|
||||
func (env *Environment) GetUnlocked(name string) (bool, string) {
|
||||
if value, found := env.Data[name]; found {
|
||||
return true, value
|
||||
}
|
||||
|
||||
return false, ""
|
||||
}
|
||||
|
||||
func (env *Environment) Get(name string) (bool, string) {
|
||||
env.Lock()
|
||||
defer env.Unlock()
|
||||
return env.GetUnlocked(name)
|
||||
}
|
||||
|
||||
func (env *Environment) GetInt(name string) (error, int) {
|
||||
if found, value := env.Get(name); found {
|
||||
if i, err := strconv.Atoi(value); err == nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue