source

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadUpgrade = errors.New("matt::chasm::source: bad upgrade")
	ErrBadRead    = errors.New("matt::chasm::source: bad read")
)

Functions

This section is empty.

Types

type BookProto added in v0.14.1

type BookProto interface {
	Proto
	SingleDecoder[core.BookEvent]
}

type CandleProto added in v0.14.1

type CandleProto interface {
	Proto
	SinkDecoder[core.CandleEvent]
}

type DecodeKeyFunc

type DecodeKeyFunc func(raw []byte) []core.Key

TODO: we should be returning an error

type KeyGetter

type KeyGetter interface {
	Online() []core.Key
	Offline() []core.Key
	All() []core.Key
}

func NewKeyGetter

func NewKeyGetter(online, offline, all DecodeKeyFunc, req http.Request) KeyGetter

type MultiDecoder added in v0.14.1

type MultiDecoder[T core.Event] interface {
	Decode(frame []byte, destination []T) (int, bool, error)
}

type Proto

type Proto interface {
	Endpoint() string
	Subscribe(key core.Key) []byte
	Unsubscribe(key core.Key) []byte
}

type Reader

type Reader[T core.Event] interface {
	Open() error
	Close() error
	Read() (T, bool)
	Next() error
}

type SingleDecoder added in v0.14.1

type SingleDecoder[T core.Event] interface {
	Decode(frame []byte) (T, bool, error)
}

type SinkDecoder added in v0.14.1

type SinkDecoder[T core.Event] interface {
	Sink(key core.Key, frame []byte) (T, bool, error)
	Rebuild(key core.Key) (T, bool, error)
}

type Source

type Source interface {
	Symbol(key core.Key) Reader[core.SymbolEvent]
	Book(key core.Key) Reader[core.BookEvent]
	Candle(key core.Key) Reader[core.CandleEvent]
	Trade(key core.Key) Reader[core.TradeEvent]
	Get() KeyGetter
}

func NewSource

func NewSource(origin string,
	symbol SymbolProto, book BookProto, trade TradeProto, candle CandleProto, getter KeyGetter) Source

type SymbolProto added in v0.14.1

type SymbolProto interface {
	Proto
	MultiDecoder[core.SymbolEvent]
}

type TradeProto added in v0.14.1

type TradeProto interface {
	Proto
	MultiDecoder[core.TradeEvent]
}

Jump to

Keyboard shortcuts

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