Skip to content

Commit

Permalink
Fixed PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
chathumi-k committed Jan 7, 2025
1 parent 7db31f0 commit 477f74c
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 140 deletions.
2 changes: 1 addition & 1 deletion examples/crypto-perp-stream/crypto_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func main() {
stream.WithCryptoDailyBars(func(cb stream.CryptoBar) {
fmt.Printf("DAILY BAR: %+v\n", cb)
}, "BTC-PERP"),
stream.WithFuturesPricing(func(fp stream.CryptoFuturesPricing) {
stream.WithCryptoPerpPricing(func(fp stream.CryptoPerpPricing) {
fmt.Printf("FUTURES PRICING: %+v\n", fp)
}, "BTC-PERP"),
)
Expand Down
2 changes: 1 addition & 1 deletion marketdata/stream/entities.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func (e errorMessage) Error() string {
return e.msg
}

type CryptoFuturesPricing struct {
type CryptoPerpPricing struct {
Symbol string
Timestamp time.Time
Exchange string
Expand Down
260 changes: 130 additions & 130 deletions marketdata/stream/entities_easyjson.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions marketdata/stream/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ type cryptoMsgHandler struct {
updatedBarHandler func(CryptoBar)
dailyBarHandler func(CryptoBar)
orderbookHandler func(CryptoOrderbook)
futuresPricingHandler func(CryptoFuturesPricing)
futuresPricingHandler func(CryptoPerpPricing)
}

var _ msgHandler = (*cryptoMsgHandler)(nil)
Expand Down Expand Up @@ -489,7 +489,7 @@ func (h *cryptoMsgHandler) handleTrade(d *msgpack.Decoder, n int) error {
}

func (h *cryptoMsgHandler) handleFuturesPricing(d *msgpack.Decoder, n int) error {
pricing := CryptoFuturesPricing{}
pricing := CryptoPerpPricing{}
for i := 0; i < n; i++ {
key, err := d.DecodeString()
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions marketdata/stream/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ type cryptoOptions struct {
updatedBarHandler func(CryptoBar)
dailyBarHandler func(CryptoBar)
orderbookHandler func(CryptoOrderbook)
pricingHandler func(CryptoFuturesPricing)
pricingHandler func(CryptoPerpPricing)
}

// defaultCryptoOptions are the default options for a client.
Expand Down Expand Up @@ -364,7 +364,7 @@ func defaultCryptoOptions() *cryptoOptions {
updatedBarHandler: func(_ CryptoBar) {},
dailyBarHandler: func(_ CryptoBar) {},
orderbookHandler: func(_ CryptoOrderbook) {},
pricingHandler: func(_ CryptoFuturesPricing) {},
pricingHandler: func(_ CryptoPerpPricing) {},
}
}

Expand Down Expand Up @@ -396,8 +396,8 @@ func WithCryptoTrades(handler func(CryptoTrade), symbols ...string) CryptoOption
})
}

// WithFuturesPricing configures initial pricing symbols to subscribe to and the handler
func WithFuturesPricing(handler func(CryptoFuturesPricing), symbols ...string) CryptoOption {
// WithCryptoPerpPricing configures initial pricing symbols to subscribe to and the handler
func WithCryptoPerpPricing(handler func(CryptoPerpPricing), symbols ...string) CryptoOption {
return newFuncCryptoOption(func(o *cryptoOptions) {
o.sub.futuresPricing = symbols
o.pricingHandler = handler
Expand Down
Loading

0 comments on commit 477f74c

Please sign in to comment.