Documentation
¶
Index ¶
- Variables
- func HandleMessage[T bls.Message](ctx context.Context, from peer.ID, payload []byte, ...) error
- func NewCore(log zerolog.Logger, host *host.Host, opts ...Option) *core
- type Config
- type Core
- type Logger
- type Messaging
- type Network
- type NodeOps
- type Option
- type Pipeline
- type PipelineID
- type Telemetry
Constants ¶
This section is empty.
Variables ¶
View Source
var Counters = []prometheus.CounterDefinition{
{
Name: directMessagesMetric,
Help: "Number of direct messages this node received.",
},
{
Name: topicMessagesMetric,
Help: "Number of topic messages this node received.",
},
{
Name: subscriptionsMetric,
Help: "Number of topics this node subscribes to.",
},
{
Name: messagesSentMetric,
Help: "Number of messages sent.",
},
{
Name: messagesPublishedMetric,
Help: "Number of messages published.",
},
{
Name: messagesProcessedMetric,
Help: "Number of messages this node processed.",
},
{
Name: messagesProcessedOkMetric,
Help: "Number of messages successfully processed by the node.",
},
{
Name: messagesProcessedErrMetric,
Help: "Number of messages processed with an error.",
},
}
View Source
var DefaultConfig = Config{ Topics: []string{bls.DefaultTopic}, HealthInterval: bls.DefaultHealthInterval, Concurrency: bls.DefaultConcurrency, }
DefaultConfig represents the default settings for the node core.
View Source
var DirectMessagePipeline = Pipeline{ID: DirectMessage}
View Source
var ( Gauges = []prometheus.GaugeDefinition{ { Name: NodeInfoMetric, Help: "Information about the b7s node.", }, } )
View Source
var (
NodeInfoMetric = []string{"node", "info"}
)
Functions ¶
func HandleMessage ¶
Types ¶
type Messaging ¶
type Messaging interface {
Send(context.Context, peer.ID, bls.Message) error
SendToMany(context.Context, []peer.ID, bls.Message, bool) error
JoinTopic(string) error
Subscribe(context.Context, string) error
Publish(context.Context, bls.Message) error
PublishToTopic(context.Context, string, bls.Message) error
}
type Option ¶
type Option func(*Config)
Option can be used to set Node configuration options.
func Concurrency ¶
Concurrency specifies how many requests the node should process in parallel.
func HealthInterval ¶
HealthInterval specifies how often we should emit the health signal.
type Pipeline ¶
type Pipeline struct {
ID PipelineID // ID of the pipeline on which the message was received.
Topic string // optional - topic on which this message was published.
}
func PubSubPipeline ¶
type PipelineID ¶
type PipelineID int
const ( PubSub PipelineID = iota + 1 DirectMessage )
func (PipelineID) String ¶
func (i PipelineID) String() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.