Documentation ¶
Index ¶
- type ActivityState
- type Aggregator
- type Component
- type Option
- type Oracle
- func (meta Oracle) ActivityState() ActivityState
- func (o *Oracle) Close() error
- func (o *Oracle) EventLoop() error
- func (meta Oracle) OutputType() core.RegisterType
- func (meta Oracle) PUUID() core.PUUID
- func (meta Oracle) StateKey() *core.StateKey
- func (meta Oracle) Type() core.ComponentType
- func (meta Oracle) UUID() core.CUUID
- type OracleConstructorFunc
- type OracleDefinition
- type OracleType
- type Pipe
- func (meta Pipe) ActivityState() ActivityState
- func (p *Pipe) Close() error
- func (p *Pipe) EventLoop() error
- func (meta Pipe) OutputType() core.RegisterType
- func (meta Pipe) PUUID() core.PUUID
- func (meta Pipe) StateKey() *core.StateKey
- func (meta Pipe) Type() core.ComponentType
- func (meta Pipe) UUID() core.CUUID
- type PipeConstructorFunc
- type PipeDefinition
- type StateChange
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivityState ¶
type ActivityState int
const ( Inactive ActivityState = iota Live Terminated )
func (ActivityState) String ¶
func (as ActivityState) String() string
type Component ¶
type Component interface { /* NOTE - Storing the PUUID assumes that one component can only be a part of one pipeline at a time. This could be problematic if we want to have a component be a part of multiple pipelines at once. In that case, we would need to store a slice of PUUIDs instead. */ // PUUID ... Returns component's PUUID PUUID() core.PUUID // UUID ... UUID() core.CUUID // Type ... Returns component enum type Type() core.ComponentType // AddRelay ... Adds an engine relay to component egress routing AddRelay(relay *core.EngineInputRelay) error // AddEgress ... AddEgress(core.CUUID, chan core.TransitData) error // RemoveEgress ... RemoveEgress(core.CUUID) error // Close ... Signifies a component to stop operating Close() error // EventLoop ... Component driver function; spun up as separate go routine EventLoop() error // GetIngress ... Returns component ingress channel for some register type value GetIngress(rt core.RegisterType) (chan core.TransitData, error) // OutputType ... Returns component output data type OutputType() core.RegisterType StateKey() *core.StateKey // TODO(#24): Add Internal Component Activity State Tracking ActivityState() ActivityState }
Component ... Generalized interface that all pipeline components must adhere to
func NewOracle ¶
func NewOracle(ctx context.Context, outType core.RegisterType, od OracleDefinition, opts ...Option) (Component, error)
NewOracle ... Initializer
func NewPipe ¶
func NewPipe(ctx context.Context, pd PipeDefinition, inType core.RegisterType, outType core.RegisterType, opts ...Option) (Component, error)
NewPipe ... Initializer
type Option ¶
type Option = func(*metaData)
Option ... Component type agnostic option
func WithEventChan ¶
func WithEventChan(sc chan StateChange) Option
WithEventChan ... Passes state channel to component metadata field
func WithInTypes ¶
func WithInTypes(its []core.RegisterType) Option
WithInTypes ... Passes input types to component metadata field
func WithStateKey ¶
WithStateKey ... Passes state key to component metadata field
type Oracle ¶
type Oracle struct {
// contains filtered or unexported fields
}
Oracle ... Component used to represent a data source reader; E.g, Eth block indexing, interval API polling
func (Oracle) ActivityState ¶
func (meta Oracle) ActivityState() ActivityState
ActivityState ... Returns component current activity state
func (*Oracle) Close ¶
Close ... This function is called at the end when processes related to oracle need to shut down
func (*Oracle) EventLoop ¶
EventLoop ... Component loop that actively waits and transits register data from a channel that the definition's read routine writes to
func (Oracle) OutputType ¶
func (meta Oracle) OutputType() core.RegisterType
OutputType ... Returns component's data output type
func (Oracle) PUUID ¶
UUID ... Returns component's PUUID NOTE - This currently assumes that component collisions are impossible
type OracleConstructorFunc ¶
type OracleConstructorFunc = func(context.Context, *core.ClientConfig, ...Option) (Component, error)
OracleConstructorFunc ... Type declaration that a registry oracle component constructor must adhere to
type OracleDefinition ¶
type OracleDefinition interface { BackTestRoutine(ctx context.Context, componentChan chan core.TransitData, startHeight *big.Int, endHeight *big.Int) error ReadRoutine(ctx context.Context, componentChan chan core.TransitData) error }
OracleDefinition ... Provides a generalized interface for developers to bind their own functionality to
type OracleType ¶
type OracleType = string
OracleType ...
const ( // BackTestOracle ... Represents an oracle used for backtesting some heuristic BacktestOracle OracleType = "backtest" // LiveOracle ... Represents an oracle used for powering some live heuristic LiveOracle OracleType = "live" )
type Pipe ¶
type Pipe struct {
// contains filtered or unexported fields
}
func (Pipe) ActivityState ¶
func (meta Pipe) ActivityState() ActivityState
ActivityState ... Returns component current activity state
func (*Pipe) EventLoop ¶
EventLoop ... Driver loop for component that actively subscribes to an input channel where transit data is read, transformed, and transitte to downstream components
func (Pipe) OutputType ¶
func (meta Pipe) OutputType() core.RegisterType
OutputType ... Returns component's data output type
func (Pipe) PUUID ¶
UUID ... Returns component's PUUID NOTE - This currently assumes that component collisions are impossible
type PipeConstructorFunc ¶
PipeConstructorFunc ... Type declaration that a registry pipe component constructor must adhere to
type PipeDefinition ¶
type PipeDefinition interface {
Transform(ctx context.Context, data core.TransitData) ([]core.TransitData, error)
}
type StateChange ¶
type StateChange struct { ID core.CUUID From ActivityState // S To ActivityState // S' }
StateChange ... Represents a component state change event that is processed by component management logic to determine proper pipeline states and duplicate pipeline merging opportunities