github.com/diadata-org/diadata@v1.4.593/pkg/graphql/resolver/vwalpresolver.go (about)

     1  package resolver
     2  
     3  import (
     4  	"context"
     5  	"time"
     6  
     7  	"github.com/graph-gophers/graphql-go"
     8  )
     9  
    10  type vwalp struct {
    11  	Symbol string
    12  	Value  float64
    13  	Time   time.Time
    14  }
    15  
    16  type VWALPResolver struct {
    17  	q vwalp
    18  }
    19  
    20  func (vr *VWALPResolver) Symbol(ctx context.Context) (*string, error) {
    21  	return &vr.q.Symbol, nil
    22  }
    23  
    24  func (vr *VWALPResolver) Value(ctx context.Context) (*float64, error) {
    25  	return &vr.q.Value, nil
    26  }
    27  
    28  func (vr *VWALPResolver) Time(ctx context.Context) (*graphql.Time, error) {
    29  	return &graphql.Time{Time: vr.q.Time}, nil
    30  }