27 lines
651 B
Go
27 lines
651 B
Go
package remoteUtil
|
|
|
|
import (
|
|
"github.com/go-resty/resty/v2"
|
|
)
|
|
|
|
type EvidenceParam struct {
|
|
Url string `json:"url"`
|
|
Type string `json:"type"`
|
|
MemberName string `json:"memberName"`
|
|
ContractAddress string `json:"contractAddress"`
|
|
FunctionName string `json:"functionName"`
|
|
Args []string `json:"args"`
|
|
Token string `json:"token"`
|
|
}
|
|
|
|
func Evidence(EvidenceParam EvidenceParam) error {
|
|
httpClient := resty.New().R()
|
|
_, err := httpClient.SetHeader("Content-Type", "application/json").
|
|
SetBody(&EvidenceParam).
|
|
Post(EvidenceParam.Url)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|