mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 05:23:19 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
756c04fd95
commit
ba4793f980
2 changed files with 39 additions and 48 deletions
|
@ -1,7 +1,6 @@
|
|||
package session
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
|
@ -45,32 +44,6 @@ var (
|
|||
|
||||
type UnknownCommandCallback func(cmd string) bool
|
||||
|
||||
type ModuleList []Module
|
||||
|
||||
type JSONModule struct {
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Author string `json:"author"`
|
||||
Parameters map[string]*ModuleParam `json:"parameters"`
|
||||
Handlers []ModuleHandler `json:"handlers"`
|
||||
Running bool `json:"running"`
|
||||
}
|
||||
|
||||
func (mm ModuleList) MarshalJSON() ([]byte, error) {
|
||||
mods := []JSONModule{}
|
||||
for _, m := range mm {
|
||||
mods = append(mods, JSONModule{
|
||||
Name: m.Name(),
|
||||
Description: m.Description(),
|
||||
Author: m.Author(),
|
||||
Parameters: m.Parameters(),
|
||||
Handlers: m.Handlers(),
|
||||
Running: m.Running(),
|
||||
})
|
||||
}
|
||||
return json.Marshal(mods)
|
||||
}
|
||||
|
||||
type GPS struct {
|
||||
Latitude float64 // Latitude.
|
||||
Longitude float64 // Longitude.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue