Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add back the internal received at timestamp #319

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions marketdata/stream/entities.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ type Trade struct {
Timestamp time.Time
Conditions []string
Tape string

internal tradeInternal
}

type tradeInternal struct {
ReceivedAt time.Time
}

// Internal contains internal fields. There aren't any behavioural or backward compatibility
// promises for them: they can be empty or removed in the future. You should not use them at all.
func (t Trade) Internal() tradeInternal { //nolint:revive // We intentionally return an unexported struct here
return t.internal
}

// Quote is a stock quote from the market
Expand All @@ -33,6 +45,18 @@ type Quote struct {
Timestamp time.Time
Conditions []string
Tape string

internal quoteInternal
}

type quoteInternal struct {
ReceivedAt time.Time
}

// Internal contains internal fields. There aren't any behavioural or backward compatibility
// promises for them: they can be empty or removed in the future. You should not use them at all.
func (q Quote) Internal() quoteInternal { //nolint:revive // We intentionally return an unexported struct here
return q.internal
}

// Bar is an aggregate of trades
Expand Down Expand Up @@ -142,10 +166,12 @@ type CryptoOrderbookEntry struct {
Size float64
}

type CryptoPerpTrade CryptoTrade
type CryptoPerpQuote CryptoQuote
type CryptoPerpBar CryptoBar
type CryptoPerpOrderbook CryptoOrderbook
type (
CryptoPerpTrade CryptoTrade
CryptoPerpQuote CryptoQuote
CryptoPerpBar CryptoBar
CryptoPerpOrderbook CryptoOrderbook
)

// OptionTrade is an option trade that happened on the market
type OptionTrade struct {
Expand Down
Loading
Loading