wire

由 doc2go 直接从当前 Go 源码与 doc comments 生成。

package wire

import "github.com/bsv8/go-bitfs/wire"

Package wire is the transport-facing dispatcher for the new protocol. Kind is carried by the transport; it is intentionally not wrapped into the signed CBOR documents defined by 001-007.

Index

Constants

const ProtocolFamily = "bitfs.protocol.v3"

Functions

func MarshalArbitrationRequest

func MarshalArbitrationRequest(message *arbitration.ArbitrationRequest) ([]byte, error)

func MarshalArbitrationResponse

func MarshalArbitrationResponse(message *arbitration.ArbitrationResponse) ([]byte, error)

func MarshalContentDelivery

func MarshalContentDelivery(message *bitfs.SignedContentDelivery) ([]byte, error)

func MarshalContentRequest

func MarshalContentRequest(message *bitfs.SignedContentRequest) ([]byte, error)

func MarshalPaymentUpdate

func MarshalPaymentUpdate(message *pool.PaymentUpdate) ([]byte, error)

func MarshalPoolFundingTxDelivery

func MarshalPoolFundingTxDelivery(message *pool.FundingTxDelivery) ([]byte, error)

func MarshalPoolRefundPresignRequest

func MarshalPoolRefundPresignRequest(message *pool.RefundPresignRequest) ([]byte, error)

func MarshalPoolRefundPresignResponse

func MarshalPoolRefundPresignResponse(message *pool.RefundPresignResponse) ([]byte, error)

func MarshalQuote

func MarshalQuote(message *bitfs.SignedFileQuote) ([]byte, error)

func Unmarshal

func Unmarshal(kind Kind, rawCBOR []byte) (any, error)

func UnmarshalArbitrationRequest

func UnmarshalArbitrationRequest(rawCBOR []byte) (*arbitration.ArbitrationRequest, error)

func UnmarshalArbitrationResponse

func UnmarshalArbitrationResponse(rawCBOR []byte) (*arbitration.ArbitrationResponse, error)

func UnmarshalContentDelivery

func UnmarshalContentDelivery(rawCBOR []byte) (*bitfs.SignedContentDelivery, error)

func UnmarshalContentRequest

func UnmarshalContentRequest(rawCBOR []byte) (*bitfs.SignedContentRequest, error)

func UnmarshalPaymentUpdate

func UnmarshalPaymentUpdate(rawCBOR []byte) (*pool.PaymentUpdate, error)

func UnmarshalPoolFundingTxDelivery

func UnmarshalPoolFundingTxDelivery(rawCBOR []byte) (*pool.FundingTxDelivery, error)

func UnmarshalPoolRefundPresignRequest

func UnmarshalPoolRefundPresignRequest(rawCBOR []byte) (*pool.RefundPresignRequest, error)

func UnmarshalPoolRefundPresignResponse

func UnmarshalPoolRefundPresignResponse(rawCBOR []byte) (*pool.RefundPresignResponse, error)

func UnmarshalQuote

func UnmarshalQuote(rawCBOR []byte) (*bitfs.SignedFileQuote, error)

Types

type Kind

type Kind uint16
const (
	Quote                     Kind = 1
	PoolRefundPresignRequest  Kind = 2
	PoolRefundPresignResponse Kind = 3
	PoolFundingTxDelivery     Kind = 4
	ContentRequest            Kind = 5
	ContentDelivery           Kind = 6
	CumulativePayment         Kind = 7
	ArbitrationRequest        Kind = 8
	ArbitrationResponse       Kind = 9
)

type Packet

type Packet struct {
	Kind Kind
	CBOR []byte
}

Packet is the exact CBOR data item to pass to a transport adapter.

func Marshal
func Marshal(kind Kind, message any) (Packet, error)