request

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: ISC Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Err_BlockNotFound = errors.New("block not exist")
	Err_PeerClosed    = errors.New("peer has closed")
)

Functions

This section is empty.

Types

type IRegister

type IRegister interface {
	RegisterReceiveBlock(func(types.IBlock) error)
	RegisterReceiveMessage(func(types.IMessage) error)
}

type IRequestHandler

type IRequestHandler interface {
	server.IService
	ISend
	IRegister
	IResponse
}

type IResponse

type IResponse interface {
	SendToReady(stream network.Stream)
}

type ISend

type ISend interface {
	LastHeight(conn *types.Conn) (uint64, error)
	SendMsg(conn *types.Conn, msg types.IMessage) error
	SendBlock(conn *types.Conn, block types.IBlock) error
	GetBlocks(conn *types.Conn, height, count uint64) ([]types.IBlock, error)
	GetBlock(conn *types.Conn, height uint64) (types.IBlock, error)
	IsEqual(conn *types.Conn, header types.IHeader) (bool, error)
	LocalInfo(conn *types.Conn) (*types.Local, error)
}

Jump to

Keyboard shortcuts

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