status-go/protocol/requests/add_centralized_metric.go

23 lines
426 B
Go

package requests
import (
"errors"
"github.com/status-im/status-go/centralizedmetrics/common"
)
var (
ErrAddCentralizedMetricInvalidMetric = errors.New("add-centralized-metric: no metric")
)
type AddCentralizedMetric struct {
Metric *common.Metric `json:"metric"`
}
func (a *AddCentralizedMetric) Validate() error {
if a.Metric == nil {
return ErrAddCentralizedMetricInvalidMetric
}
return a.Metric.Validate()
}