Documentation ¶
Overview ¶
Package handler is a generated GoMock package.
Index ¶
- type Handler
- type MessageQueue
- type MockHandler
- func (m *MockHandler) Bootstrapper() common.BootstrapableEngine
- func (m *MockHandler) Consensus() common.Engine
- func (m *MockHandler) Context() *snow.ConsensusContext
- func (m *MockHandler) EXPECT() *MockHandlerMockRecorder
- func (m *MockHandler) HealthCheck(arg0 context.Context) (interface{}, error)
- func (m *MockHandler) IsValidator(arg0 ids.NodeID) bool
- func (m *MockHandler) Len() int
- func (m *MockHandler) Push(arg0 context.Context, arg1 message.InboundMessage)
- func (m *MockHandler) RegisterTimeout(arg0 time.Duration)
- func (m *MockHandler) SetBootstrapper(arg0 common.BootstrapableEngine)
- func (m *MockHandler) SetConsensus(arg0 common.Engine)
- func (m *MockHandler) SetOnStopped(arg0 func())
- func (m *MockHandler) SetStateSyncer(arg0 common.StateSyncer)
- func (m *MockHandler) Start(arg0 context.Context, arg1 bool)
- func (m *MockHandler) StateSyncer() common.StateSyncer
- func (m *MockHandler) Stop(arg0 context.Context)
- func (m *MockHandler) StopWithError(arg0 context.Context, arg1 error)
- func (m *MockHandler) Stopped() chan struct{}
- type MockHandlerMockRecorder
- func (mr *MockHandlerMockRecorder) Bootstrapper() *gomock.Call
- func (mr *MockHandlerMockRecorder) Consensus() *gomock.Call
- func (mr *MockHandlerMockRecorder) Context() *gomock.Call
- func (mr *MockHandlerMockRecorder) HealthCheck(arg0 interface{}) *gomock.Call
- func (mr *MockHandlerMockRecorder) IsValidator(arg0 interface{}) *gomock.Call
- func (mr *MockHandlerMockRecorder) Len() *gomock.Call
- func (mr *MockHandlerMockRecorder) Push(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockHandlerMockRecorder) RegisterTimeout(arg0 interface{}) *gomock.Call
- func (mr *MockHandlerMockRecorder) SetBootstrapper(arg0 interface{}) *gomock.Call
- func (mr *MockHandlerMockRecorder) SetConsensus(arg0 interface{}) *gomock.Call
- func (mr *MockHandlerMockRecorder) SetOnStopped(arg0 interface{}) *gomock.Call
- func (mr *MockHandlerMockRecorder) SetStateSyncer(arg0 interface{}) *gomock.Call
- func (mr *MockHandlerMockRecorder) Start(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockHandlerMockRecorder) StateSyncer() *gomock.Call
- func (mr *MockHandlerMockRecorder) Stop(arg0 interface{}) *gomock.Call
- func (mr *MockHandlerMockRecorder) StopWithError(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockHandlerMockRecorder) Stopped() *gomock.Call
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface { common.Timer health.Checker Context() *snow.ConsensusContext IsValidator(nodeID ids.NodeID) bool SetStateSyncer(engine common.StateSyncer) StateSyncer() common.StateSyncer SetBootstrapper(engine common.BootstrapableEngine) Bootstrapper() common.BootstrapableEngine SetConsensus(engine common.Engine) Consensus() common.Engine SetOnStopped(onStopped func()) Start(ctx context.Context, recoverPanic bool) Push(ctx context.Context, msg message.InboundMessage) Len() int Stop(ctx context.Context) StopWithError(ctx context.Context, err error) Stopped() chan struct{} }
func New ¶
func New( ctx *snow.ConsensusContext, validators validators.Set, msgFromVMChan <-chan common.Message, preemptTimeouts chan struct{}, gossipFrequency time.Duration, resourceTracker tracker.ResourceTracker, subnetConnector validators.SubnetConnector, ) (Handler, error)
Initialize this consensus handler [engine] must be initialized before initializing this handler
type MessageQueue ¶
type MessageQueue interface { // Add a message. // // If called after [Shutdown], the message will immediately be marked as // having been handled. Push(context.Context, message.InboundMessage) // Remove and return a message and its context. // // If there are no available messages, this function will block until a // message becomes available or the queue is [Shutdown]. Pop() (context.Context, message.InboundMessage, bool) // Returns the number of messages currently on the queue Len() int // Shutdown and empty the queue. Shutdown() }
func NewMessageQueue ¶
func NewMessageQueue( log logging.Logger, vdrs validators.Set, cpuTracker tracker.Tracker, metricsNamespace string, metricsRegisterer prometheus.Registerer, ops []message.Op, ) (MessageQueue, error)
type MockHandler ¶
type MockHandler struct {
// contains filtered or unexported fields
}
MockHandler is a mock of Handler interface.
func NewMockHandler ¶
func NewMockHandler(ctrl *gomock.Controller) *MockHandler
NewMockHandler creates a new mock instance.
func (*MockHandler) Bootstrapper ¶
func (m *MockHandler) Bootstrapper() common.BootstrapableEngine
Bootstrapper mocks base method.
func (*MockHandler) Consensus ¶
func (m *MockHandler) Consensus() common.Engine
Consensus mocks base method.
func (*MockHandler) Context ¶
func (m *MockHandler) Context() *snow.ConsensusContext
Context mocks base method.
func (*MockHandler) EXPECT ¶
func (m *MockHandler) EXPECT() *MockHandlerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockHandler) HealthCheck ¶
func (m *MockHandler) HealthCheck(arg0 context.Context) (interface{}, error)
HealthCheck mocks base method.
func (*MockHandler) IsValidator ¶
func (m *MockHandler) IsValidator(arg0 ids.NodeID) bool
IsValidator mocks base method.
func (*MockHandler) Push ¶
func (m *MockHandler) Push(arg0 context.Context, arg1 message.InboundMessage)
Push mocks base method.
func (*MockHandler) RegisterTimeout ¶
func (m *MockHandler) RegisterTimeout(arg0 time.Duration)
RegisterTimeout mocks base method.
func (*MockHandler) SetBootstrapper ¶
func (m *MockHandler) SetBootstrapper(arg0 common.BootstrapableEngine)
SetBootstrapper mocks base method.
func (*MockHandler) SetConsensus ¶
func (m *MockHandler) SetConsensus(arg0 common.Engine)
SetConsensus mocks base method.
func (*MockHandler) SetOnStopped ¶
func (m *MockHandler) SetOnStopped(arg0 func())
SetOnStopped mocks base method.
func (*MockHandler) SetStateSyncer ¶
func (m *MockHandler) SetStateSyncer(arg0 common.StateSyncer)
SetStateSyncer mocks base method.
func (*MockHandler) Start ¶
func (m *MockHandler) Start(arg0 context.Context, arg1 bool)
Start mocks base method.
func (*MockHandler) StateSyncer ¶
func (m *MockHandler) StateSyncer() common.StateSyncer
StateSyncer mocks base method.
func (*MockHandler) StopWithError ¶
func (m *MockHandler) StopWithError(arg0 context.Context, arg1 error)
StopWithError mocks base method.
func (*MockHandler) Stopped ¶
func (m *MockHandler) Stopped() chan struct{}
Stopped mocks base method.
type MockHandlerMockRecorder ¶
type MockHandlerMockRecorder struct {
// contains filtered or unexported fields
}
MockHandlerMockRecorder is the mock recorder for MockHandler.
func (*MockHandlerMockRecorder) Bootstrapper ¶
func (mr *MockHandlerMockRecorder) Bootstrapper() *gomock.Call
Bootstrapper indicates an expected call of Bootstrapper.
func (*MockHandlerMockRecorder) Consensus ¶
func (mr *MockHandlerMockRecorder) Consensus() *gomock.Call
Consensus indicates an expected call of Consensus.
func (*MockHandlerMockRecorder) Context ¶
func (mr *MockHandlerMockRecorder) Context() *gomock.Call
Context indicates an expected call of Context.
func (*MockHandlerMockRecorder) HealthCheck ¶
func (mr *MockHandlerMockRecorder) HealthCheck(arg0 interface{}) *gomock.Call
HealthCheck indicates an expected call of HealthCheck.
func (*MockHandlerMockRecorder) IsValidator ¶
func (mr *MockHandlerMockRecorder) IsValidator(arg0 interface{}) *gomock.Call
IsValidator indicates an expected call of IsValidator.
func (*MockHandlerMockRecorder) Len ¶
func (mr *MockHandlerMockRecorder) Len() *gomock.Call
Len indicates an expected call of Len.
func (*MockHandlerMockRecorder) Push ¶
func (mr *MockHandlerMockRecorder) Push(arg0, arg1 interface{}) *gomock.Call
Push indicates an expected call of Push.
func (*MockHandlerMockRecorder) RegisterTimeout ¶
func (mr *MockHandlerMockRecorder) RegisterTimeout(arg0 interface{}) *gomock.Call
RegisterTimeout indicates an expected call of RegisterTimeout.
func (*MockHandlerMockRecorder) SetBootstrapper ¶
func (mr *MockHandlerMockRecorder) SetBootstrapper(arg0 interface{}) *gomock.Call
SetBootstrapper indicates an expected call of SetBootstrapper.
func (*MockHandlerMockRecorder) SetConsensus ¶
func (mr *MockHandlerMockRecorder) SetConsensus(arg0 interface{}) *gomock.Call
SetConsensus indicates an expected call of SetConsensus.
func (*MockHandlerMockRecorder) SetOnStopped ¶
func (mr *MockHandlerMockRecorder) SetOnStopped(arg0 interface{}) *gomock.Call
SetOnStopped indicates an expected call of SetOnStopped.
func (*MockHandlerMockRecorder) SetStateSyncer ¶
func (mr *MockHandlerMockRecorder) SetStateSyncer(arg0 interface{}) *gomock.Call
SetStateSyncer indicates an expected call of SetStateSyncer.
func (*MockHandlerMockRecorder) Start ¶
func (mr *MockHandlerMockRecorder) Start(arg0, arg1 interface{}) *gomock.Call
Start indicates an expected call of Start.
func (*MockHandlerMockRecorder) StateSyncer ¶
func (mr *MockHandlerMockRecorder) StateSyncer() *gomock.Call
StateSyncer indicates an expected call of StateSyncer.
func (*MockHandlerMockRecorder) Stop ¶
func (mr *MockHandlerMockRecorder) Stop(arg0 interface{}) *gomock.Call
Stop indicates an expected call of Stop.
func (*MockHandlerMockRecorder) StopWithError ¶
func (mr *MockHandlerMockRecorder) StopWithError(arg0, arg1 interface{}) *gomock.Call
StopWithError indicates an expected call of StopWithError.
func (*MockHandlerMockRecorder) Stopped ¶
func (mr *MockHandlerMockRecorder) Stopped() *gomock.Call
Stopped indicates an expected call of Stopped.