qbtrade/pkg/datasource/glassnode/glassnodeapi/request.go

24 lines
709 B
Go
Raw Normal View History

2024-06-27 14:42:38 +00:00
package glassnodeapi
import (
"time"
"github.com/c9s/requestgen"
)
//go:generate requestgen -method GET -type Request -url "/v1/metrics/:category/:metric" -responseType DataSlice
type Request struct {
Client requestgen.AuthenticatedAPIClient
Asset string `param:"a,required,query"`
Since *time.Time `param:"s,query,seconds"`
Until *time.Time `param:"u,query,seconds"`
Interval *Interval `param:"i,query"`
Format *Format `param:"f,query" default:"JSON"`
Currency *string `param:"c,query"`
TimestampFormat *string `param:"timestamp_format,query"`
Category string `param:"category,slug"`
Metric string `param:"metric,slug"`
}