Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d691648916 | ||
|
|
8060cdb508 |
@@ -6,11 +6,11 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func New(endpoint string, data []*LogItem) error {
|
||||
func New(endpoint string, data LogRequest) error {
|
||||
go PostLog(data, endpoint)
|
||||
return nil
|
||||
}
|
||||
func PostLog(data []*LogItem, endpoint string) (resp *http.Response, err error) {
|
||||
func PostLog(data LogRequest, endpoint string) (resp *http.Response, err error) {
|
||||
jsonBytes, err := json.Marshal(data)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package oplog
|
||||
|
||||
type LogRequest struct {
|
||||
Data []*LogItem `json:"data"`
|
||||
}
|
||||
type LogItem struct {
|
||||
OpID uint `json:"op_id"`
|
||||
OpName string `json:"op_name"`
|
||||
|
||||
Reference in New Issue
Block a user