mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -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 {
|
type sessionJSON struct {
|
||||||
|
Version string `json:"version"`
|
||||||
|
OS string `json:"os"`
|
||||||
|
Arch string `json:"arch"`
|
||||||
|
GoVersion string `json:"goversion"`
|
||||||
Options core.Options `json:"options"`
|
Options core.Options `json:"options"`
|
||||||
Interface *network.Endpoint `json:"interface"`
|
Interface *network.Endpoint `json:"interface"`
|
||||||
Gateway *network.Endpoint `json:"gateway"`
|
Gateway *network.Endpoint `json:"gateway"`
|
||||||
|
@ -144,6 +148,10 @@ func New() (*Session, error) {
|
||||||
|
|
||||||
func (s *Session) MarshalJSON() ([]byte, error) {
|
func (s *Session) MarshalJSON() ([]byte, error) {
|
||||||
doc := sessionJSON{
|
doc := sessionJSON{
|
||||||
|
Version: core.Version,
|
||||||
|
OS: runtime.GOOS,
|
||||||
|
Arch: runtime.GOARCH,
|
||||||
|
GoVersion: runtime.Version(),
|
||||||
Options: s.Options,
|
Options: s.Options,
|
||||||
Interface: s.Interface,
|
Interface: s.Interface,
|
||||||
Gateway: s.Gateway,
|
Gateway: s.Gateway,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue