grlogs/logs/alils/callback.go

26 lines
687 B
Go
Raw Normal View History

2020-05-04 21:10:20 +08:00
package alils
import (
"fmt"
"github.com/aliyun/aliyun-log-go-sdk/producer"
)
type Callback struct {
}
func (callback *Callback) Success(result *producer.Result) {
attemptList := result.GetReservedAttempts()
for _, attempt := range attemptList {
fmt.Printf("%+v \n", attempt)
}
}
func (callback *Callback) Fail(result *producer.Result) {
2020-05-07 10:59:16 +08:00
fmt.Println("IsSuccessful", result.IsSuccessful())
fmt.Println("GetErrorCode", result.GetErrorCode())
fmt.Println("GetErrorMessage", result.GetErrorMessage())
fmt.Println("GetReservedAttempts", result.GetReservedAttempts())
fmt.Println("GetRequestId", result.GetRequestId())
fmt.Println("GetTimeStampMs", result.GetTimeStampMs())
2020-05-04 21:10:20 +08:00
}