middleware

package
v0.0.0-...-aa76b34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GRPCNodeServer

type GRPCNodeServer struct {
	proto.UnimplementedNodeServer
	// contains filtered or unexported fields
}

func NewGRPCNodeServer

func NewGRPCNodeServer(node service.Noder, nodeListenAddr string) *GRPCNodeServer

func (*GRPCNodeServer) GetBlocks

func (s *GRPCNodeServer) GetBlocks(ctx context.Context, v *proto.Version) (*proto.Blocks, error)

func (*GRPCNodeServer) Handshake

func (s *GRPCNodeServer) Handshake(ctx context.Context, v *proto.Version) (*proto.Version, error)

service methods (NodeServer interface)

func (*GRPCNodeServer) NewBlock

func (s *GRPCNodeServer) NewBlock(ctx context.Context, b *proto.Block) (*proto.Block, error)

func (*GRPCNodeServer) NewTransaction

func (s *GRPCNodeServer) NewTransaction(ctx context.Context, t *proto.Transaction) (*proto.Transaction, error)

func (*GRPCNodeServer) Serve

func (s *GRPCNodeServer) Serve() error

func (*GRPCNodeServer) Stop

func (s *GRPCNodeServer) Stop()

func (*GRPCNodeServer) String

func (s *GRPCNodeServer) String() string

type MetricsMiddleware

type MetricsMiddleware struct {
	// contains filtered or unexported fields
}

MetricsMiddleware is a middleware that collects metrics about node's it wraps the NodeServer interface

func (*MetricsMiddleware) GetBlocks

func (m *MetricsMiddleware) GetBlocks(ctx context.Context, v *proto.Version) (_ *proto.Blocks, err error)

func (*MetricsMiddleware) Handshake

func (m *MetricsMiddleware) Handshake(ctx context.Context, v *proto.Version) (_ *proto.Version, err error)

func (*MetricsMiddleware) NewBlock

func (m *MetricsMiddleware) NewBlock(ctx context.Context, b *proto.Block) (_ *proto.Block, err error)

func (*MetricsMiddleware) NewTransaction

func (m *MetricsMiddleware) NewTransaction(
	ctx context.Context,
	t *proto.Transaction,
) (_ *proto.Transaction, err error)

func (*MetricsMiddleware) String

func (m *MetricsMiddleware) String() string

type NodeServer

type NodeServer interface {
	Handshake(ctx context.Context, v *proto.Version) (*proto.Version, error)
	NewTransaction(ctx context.Context, t *proto.Transaction) (*proto.Transaction, error)
	NewBlock(ctx context.Context, b *proto.Block) (*proto.Block, error)
	GetBlocks(ctx context.Context, v *proto.Version) (*proto.Blocks, error)
	String() string
}

func NewMetricsMiddleware

func NewMetricsMiddleware(next NodeServer) NodeServer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL