Documentation
¶
Index ¶
- type Server
- func (s *Server) Blocks(r *pbbstream.BlockRequest, stream pbbstream.BlockStream_BlocksServer) error
- func (s *Server) GetHeadInfo(ctx context.Context, req *pbheadinfo.HeadInfoRequest) (*pbheadinfo.HeadInfoResponse, error)
- func (s *Server) PushBlock(blk *pbbstream.Block) error
- func (s *Server) Ready() bool
- func (s *Server) SetHeadInfo(num uint64, id string, blkTime time.Time, libNum uint64)
- type ServerOption
- type Source
- type SourceOption
- func WithLogger(logger *zap.Logger) SourceOption
- func WithNumGator(blockNum uint64, exclusive bool) SourceOption
- func WithParallelPreproc(f bstream.PreprocessFunc, threads int) SourceOption
- func WithRequester(requester string) SourceOption
- func WithTimeThresholdGator(threshold time.Duration) SourceOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewBufferedServer ¶
func NewBufferedServer(server dgrpcserver.Server, size int, opts ...ServerOption) *Server
func NewServer ¶
func NewServer(server dgrpcserver.Server, opts ...ServerOption) *Server
func NewUnmanagedServer ¶
func NewUnmanagedServer(opts ...ServerOption) *Server
NewUnmanagedServer can be used to create a BlockStream server that has no control over the actual gRPC server. Registration of services should be made manually by entity calling `blockstream.NewUnmanagedServer`.
Moreover, management methods like `Close`
func (*Server) Blocks ¶
func (s *Server) Blocks(r *pbbstream.BlockRequest, stream pbbstream.BlockStream_BlocksServer) error
func (*Server) GetHeadInfo ¶
func (s *Server) GetHeadInfo(ctx context.Context, req *pbheadinfo.HeadInfoRequest) (*pbheadinfo.HeadInfoResponse, error)
type ServerOption ¶
type ServerOption func(s *Server)
func ServerOptionWithBuffer ¶
func ServerOptionWithBuffer(size int) ServerOption
func ServerOptionWithLogger ¶
func ServerOptionWithLogger(logger *zap.Logger) ServerOption
type Source ¶
func (*Source) SetParallelPreproc ¶
func (s *Source) SetParallelPreproc(f bstream.PreprocessFunc, threads int)
type SourceOption ¶
type SourceOption = func(s *Source)
func WithLogger ¶
func WithLogger(logger *zap.Logger) SourceOption
func WithNumGator ¶
func WithNumGator(blockNum uint64, exclusive bool) SourceOption
func WithParallelPreproc ¶
func WithParallelPreproc(f bstream.PreprocessFunc, threads int) SourceOption
func WithRequester ¶
func WithRequester(requester string) SourceOption
func WithTimeThresholdGator ¶
func WithTimeThresholdGator(threshold time.Duration) SourceOption
Click to show internal directories.
Click to hide internal directories.