apiOracle

package
v0.0.0-...-7d63ed4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureValueOracle

func EnsureValueOracle() error

func SetRequestValue

func SetRequestValue(id string, at time.Time, info PriceInfo)

Types

type PriceInfo

type PriceInfo struct {
	Price, Volume float64
}

type PriceStamp

type PriceStamp struct {
	Created time.Time
	PriceInfo
}

func GetNearestTwoRequestValue

func GetNearestTwoRequestValue(id string, at time.Time) (before, after *PriceStamp)

func GetRequestValuesForTime

func GetRequestValuesForTime(id string, at time.Time, delta time.Duration) []*PriceStamp

type Window

type Window struct {
	// contains filtered or unexported fields
}

func NewWindow

func NewWindow(keep time.Duration) *Window

func (*Window) Clear

func (w *Window) Clear()

func (*Window) ClosestTwo

func (w *Window) ClosestTwo(at time.Time) (before, after *PriceStamp)

func (*Window) Insert

func (w *Window) Insert(x *PriceStamp)

func (*Window) Latest

func (w *Window) Latest() *PriceStamp

func (*Window) Len

func (w *Window) Len() int

func (*Window) MarshalJSON

func (w *Window) MarshalJSON() ([]byte, error)

func (*Window) Trim

func (w *Window) Trim()

func (*Window) UnmarshalJSON

func (w *Window) UnmarshalJSON(b []byte) error

func (*Window) WithinRange

func (w *Window) WithinRange(at time.Time, delta time.Duration) []*PriceStamp

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL