mirror of
https://github.com/datarhei/core.git
synced 2025-11-01 03:42:51 +08:00
Add basic node handling
This commit is contained in:
20
client/log.go
Normal file
20
client/log.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/datarhei/core/v16/http/api"
|
||||
)
|
||||
|
||||
func (r *restclient) Log() ([]api.LogEvent, error) {
|
||||
var log []api.LogEvent
|
||||
|
||||
data, err := r.call("GET", "/log", "", nil)
|
||||
if err != nil {
|
||||
return log, err
|
||||
}
|
||||
|
||||
err = json.Unmarshal(data, &log)
|
||||
|
||||
return log, err
|
||||
}
|
||||
Reference in New Issue
Block a user