Documentation ¶
Index ¶
- Variables
- func MakePricingHeaders(chunkPrice uint64, addr penguin.Address) (p2p.Headers, error)
- func MakePricingResponseHeaders(chunkPrice uint64, addr penguin.Address, index uint8) (p2p.Headers, error)
- func ParseIndexHeader(receivedHeaders p2p.Headers) (uint8, error)
- func ParsePriceHeader(receivedHeaders p2p.Headers) (uint64, error)
- func ParsePricingHeaders(receivedHeaders p2p.Headers) (penguin.Address, uint64, error)
- func ParsePricingResponseHeaders(receivedHeaders p2p.Headers) (penguin.Address, uint64, uint8, error)
- func ParseTargetHeader(receivedHeaders p2p.Headers) (penguin.Address, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrFieldLength denotes p2p.Header having malformed field length in bytes ErrFieldLength = errors.New("field length error") // ErrNoIndexHeader denotes p2p.Header lacking specified field ErrNoIndexHeader = errors.New("no index header") // ErrNoTargetHeader denotes p2p.Header lacking specified field ErrNoTargetHeader = errors.New("no target header") // ErrNoPriceHeader denotes p2p.Header lacking specified field ErrNoPriceHeader = errors.New("no price header") )
Functions ¶
func MakePricingHeaders ¶
func ParsePricingHeaders ¶
ParsePricingHeaders used by responder to read address and price from stream headers Returns an error if no target field attached or the contents of it are not readable
func ParsePricingResponseHeaders ¶
func ParsePricingResponseHeaders(receivedHeaders p2p.Headers) (penguin.Address, uint64, uint8, error)
ParsePricingResponseHeaders used by requester to read address, price and index from response headers Returns an error if any fields are missing or target is unreadable
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.