Documentation ¶
Overview ¶
Package routing is a generated GoMock package.
Index ¶
- type ErrMultipleNodesFound
- type ErrNodeNotFound
- type MockNodeInfoStore
- func (m *MockNodeInfoStore) Add(ctx context.Context, nodeInfo models.NodeState) error
- func (m *MockNodeInfoStore) Delete(ctx context.Context, nodeID string) error
- func (m *MockNodeInfoStore) EXPECT() *MockNodeInfoStoreMockRecorder
- func (m *MockNodeInfoStore) Get(ctx context.Context, nodeID string) (models.NodeState, error)
- func (m *MockNodeInfoStore) GetByPrefix(ctx context.Context, prefix string) (models.NodeState, error)
- func (m *MockNodeInfoStore) List(ctx context.Context, filters ...NodeStateFilter) ([]models.NodeState, error)
- type MockNodeInfoStoreMockRecorder
- func (mr *MockNodeInfoStoreMockRecorder) Add(ctx, nodeInfo interface{}) *gomock.Call
- func (mr *MockNodeInfoStoreMockRecorder) Delete(ctx, nodeID interface{}) *gomock.Call
- func (mr *MockNodeInfoStoreMockRecorder) Get(ctx, nodeID interface{}) *gomock.Call
- func (mr *MockNodeInfoStoreMockRecorder) GetByPrefix(ctx, prefix interface{}) *gomock.Call
- func (mr *MockNodeInfoStoreMockRecorder) List(ctx interface{}, filters ...interface{}) *gomock.Call
- type NodeInfoStore
- type NodeStateFilter
- type NodeStateProvider
- type NodeStateProviderParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrMultipleNodesFound ¶ added in v1.1.4
type ErrMultipleNodesFound struct {
// contains filtered or unexported fields
}
ErrMultipleNodesFound is returned when multiple nodes were found for a requested node id prefix
func NewErrMultipleNodesFound ¶ added in v1.1.4
func NewErrMultipleNodesFound(nodeIDPrefix string, matchingNodeIDs []string) ErrMultipleNodesFound
func (ErrMultipleNodesFound) Error ¶ added in v1.1.4
func (e ErrMultipleNodesFound) Error() string
type ErrNodeNotFound ¶ added in v1.0.4
type ErrNodeNotFound struct {
// contains filtered or unexported fields
}
ErrNodeNotFound is returned when nodeInfo was not found for a requested node id
func NewErrNodeNotFound ¶ added in v1.0.4
func NewErrNodeNotFound(nodeID string) ErrNodeNotFound
func (ErrNodeNotFound) Error ¶ added in v1.0.4
func (e ErrNodeNotFound) Error() string
type MockNodeInfoStore ¶ added in v1.5.2
type MockNodeInfoStore struct {
// contains filtered or unexported fields
}
MockNodeInfoStore is a mock of NodeInfoStore interface.
func NewMockNodeInfoStore ¶ added in v1.5.2
func NewMockNodeInfoStore(ctrl *gomock.Controller) *MockNodeInfoStore
NewMockNodeInfoStore creates a new mock instance.
func (*MockNodeInfoStore) Delete ¶ added in v1.5.2
func (m *MockNodeInfoStore) Delete(ctx context.Context, nodeID string) error
Delete mocks base method.
func (*MockNodeInfoStore) EXPECT ¶ added in v1.5.2
func (m *MockNodeInfoStore) EXPECT() *MockNodeInfoStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockNodeInfoStore) GetByPrefix ¶ added in v1.5.2
func (m *MockNodeInfoStore) GetByPrefix(ctx context.Context, prefix string) (models.NodeState, error)
GetByPrefix mocks base method.
func (*MockNodeInfoStore) List ¶ added in v1.5.2
func (m *MockNodeInfoStore) List(ctx context.Context, filters ...NodeStateFilter) ([]models.NodeState, error)
List mocks base method.
type MockNodeInfoStoreMockRecorder ¶ added in v1.5.2
type MockNodeInfoStoreMockRecorder struct {
// contains filtered or unexported fields
}
MockNodeInfoStoreMockRecorder is the mock recorder for MockNodeInfoStore.
func (*MockNodeInfoStoreMockRecorder) Add ¶ added in v1.5.2
func (mr *MockNodeInfoStoreMockRecorder) Add(ctx, nodeInfo interface{}) *gomock.Call
Add indicates an expected call of Add.
func (*MockNodeInfoStoreMockRecorder) Delete ¶ added in v1.5.2
func (mr *MockNodeInfoStoreMockRecorder) Delete(ctx, nodeID interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockNodeInfoStoreMockRecorder) Get ¶ added in v1.5.2
func (mr *MockNodeInfoStoreMockRecorder) Get(ctx, nodeID interface{}) *gomock.Call
Get indicates an expected call of Get.
func (*MockNodeInfoStoreMockRecorder) GetByPrefix ¶ added in v1.5.2
func (mr *MockNodeInfoStoreMockRecorder) GetByPrefix(ctx, prefix interface{}) *gomock.Call
GetByPrefix indicates an expected call of GetByPrefix.
func (*MockNodeInfoStoreMockRecorder) List ¶ added in v1.5.2
func (mr *MockNodeInfoStoreMockRecorder) List(ctx interface{}, filters ...interface{}) *gomock.Call
List indicates an expected call of List.
type NodeInfoStore ¶
type NodeInfoStore interface { // Add adds a node info to the repo. Add(ctx context.Context, nodeInfo models.NodeState) error // Get returns the node info for the given node ID. Get(ctx context.Context, nodeID string) (models.NodeState, error) // GetByPrefix returns the node info for the given node ID. // Supports both full and short node IDs. GetByPrefix(ctx context.Context, prefix string) (models.NodeState, error) // List returns a list of nodes List(ctx context.Context, filters ...NodeStateFilter) ([]models.NodeState, error) // Delete deletes a node info from the repo. Delete(ctx context.Context, nodeID string) error }
TODO rename this interface to NodeStore, it tracks more than their info
type NodeStateFilter ¶ added in v1.3.1
NodeStateFilter is a function that filters node state when listing nodes. It returns true if the node state should be returned, and false if the node state should be ignored.
type NodeStateProvider ¶ added in v1.3.1
type NodeStateProvider struct {
// contains filtered or unexported fields
}
func NewNodeStateProvider ¶ added in v1.3.1
func NewNodeStateProvider(params NodeStateProviderParams) *NodeStateProvider
func (*NodeStateProvider) GetNodeState ¶ added in v1.3.1
func (n *NodeStateProvider) GetNodeState(ctx context.Context) models.NodeState
func (*NodeStateProvider) RegisterNodeInfoDecorator ¶ added in v1.3.1
func (n *NodeStateProvider) RegisterNodeInfoDecorator(decorator models.NodeInfoDecorator)
RegisterNodeInfoDecorator registers a node info decorator with the node info provider.
type NodeStateProviderParams ¶ added in v1.3.1
type NodeStateProviderParams struct { NodeID string LabelsProvider models.LabelsProvider BacalhauVersion models.BuildVersionInfo DefaultNodeApproval models.NodeMembershipState SupportedProtocols []models.Protocol }