mirror of
https://github.com/bettercap/bettercap
synced 2025-08-11 01:06:58 -07:00
new: exporting version, os, arch, and goversion from api.rest
This commit is contained in:
parent
3edf80fc99
commit
5aa57f5cd7
1 changed files with 8 additions and 0 deletions
|
@ -79,6 +79,10 @@ type Session struct {
|
|||
}
|
||||
|
||||
type sessionJSON struct {
|
||||
Version string `json:"version"`
|
||||
OS string `json:"os"`
|
||||
Arch string `json:"arch"`
|
||||
GoVersion string `json:"goversion"`
|
||||
Options core.Options `json:"options"`
|
||||
Interface *network.Endpoint `json:"interface"`
|
||||
Gateway *network.Endpoint `json:"gateway"`
|
||||
|
@ -144,6 +148,10 @@ func New() (*Session, error) {
|
|||
|
||||
func (s *Session) MarshalJSON() ([]byte, error) {
|
||||
doc := sessionJSON{
|
||||
Version: core.Version,
|
||||
OS: runtime.GOOS,
|
||||
Arch: runtime.GOARCH,
|
||||
GoVersion: runtime.Version(),
|
||||
Options: s.Options,
|
||||
Interface: s.Interface,
|
||||
Gateway: s.Gateway,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue