Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
func NewBuffer ¶
func NewBuffer(price tokens.Pricer, tkns []tokens.Token, threshold float64, ticker ticker.Ticker) Buffer
NewBuffer creates a new token price buffer.
A token price buffer maintains a buffered view of token prices for multiple tokens. Buffered token prices are not updated unless they are outside the threshold percentage. Start steaming token prices with Buffer.Stream(ctx).
type MockBuffer ¶ added in v0.11.0
type MockBuffer struct {
// contains filtered or unexported fields
}
func NewMockBuffer ¶ added in v0.11.0
func NewMockBuffer() *MockBuffer
func (*MockBuffer) SetPrice ¶ added in v0.11.0
func (b *MockBuffer) SetPrice(token tokens.Token, price float64)
func (*MockBuffer) Stream ¶ added in v0.11.0
func (*MockBuffer) Stream(context.Context)
Click to show internal directories.
Click to hide internal directories.