Scaffold new system
This commit is contained in:
41
core/data/data.go
Normal file
41
core/data/data.go
Normal file
@@ -0,0 +1,41 @@
|
||||
// Package data ...
|
||||
package data
|
||||
|
||||
import "time"
|
||||
|
||||
type Envelope struct {
|
||||
Source string
|
||||
Key string
|
||||
Timestamp time.Time
|
||||
Sequence uint64
|
||||
Payload []byte
|
||||
}
|
||||
|
||||
type Source interface {
|
||||
Start() error
|
||||
Stop()
|
||||
Name() string
|
||||
|
||||
Subscribe(key string) (<-chan Envelope, error)
|
||||
Unsubscribe(key string) error
|
||||
|
||||
IsValidKey(key string) bool
|
||||
GetSubscriptions() []string
|
||||
}
|
||||
|
||||
type Sink interface {
|
||||
Start() error
|
||||
Stop()
|
||||
|
||||
Publish(envelope Envelope) error
|
||||
}
|
||||
|
||||
type Processor interface {
|
||||
Start(context ProcessorContext) error
|
||||
Stop()
|
||||
}
|
||||
|
||||
type ProcessorContext interface {
|
||||
Send(inPort string, messsage Envelope) error
|
||||
Receive(outPort string) Envelope
|
||||
}
|
||||
0
core/execution/execution.go
Normal file
0
core/execution/execution.go
Normal file
0
core/portfolio/portfolio.go
Normal file
0
core/portfolio/portfolio.go
Normal file
0
core/risk/risk.go
Normal file
0
core/risk/risk.go
Normal file
0
core/strategy/strategy.go
Normal file
0
core/strategy/strategy.go
Normal file
0
core/worker/worker.go
Normal file
0
core/worker/worker.go
Normal file
Reference in New Issue
Block a user