 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- Variables
- func NewMsgFromCbor(msgType uint, data []byte) (protocol.Message, error)
- type Client
- type Config
- type DoneFunc
- type InitFunc
- type MsgDone
- type MsgInit
- type MsgReplyTxIds
- type MsgReplyTxs
- type MsgRequestTxIds
- type MsgRequestTxs
- type ReplyTxIdsFunc
- type ReplyTxsFunc
- type RequestTxIdsFunc
- type RequestTxsFunc
- type Server
- type TxBody
- type TxId
- type TxIdAndSize
- type TxSubmission
- type TxSubmissionOptionFunc
- func WithDoneFunc(doneFunc DoneFunc) TxSubmissionOptionFunc
- func WithIdleTimeout(timeout time.Duration) TxSubmissionOptionFunc
- func WithInitFunc(initFunc InitFunc) TxSubmissionOptionFunc
- func WithReplyTxIdsFunc(replyTxIdsFunc ReplyTxIdsFunc) TxSubmissionOptionFunc
- func WithReplyTxsFunc(replyTxsFunc ReplyTxsFunc) TxSubmissionOptionFunc
- func WithRequestTxIdsFunc(requestTxIdsFunc RequestTxIdsFunc) TxSubmissionOptionFunc
- func WithRequestTxsFunc(requestTxsFunc RequestTxsFunc) TxSubmissionOptionFunc
 
Constants ¶
      View Source
      
  
    const ( MessageTypeRequestTxIds = 0 MessageTypeReplyTxIds = 1 MessageTypeRequestTxs = 2 MessageTypeReplyTxs = 3 MessageTypeDone = 4 MessageTypeInit = 6 )
      View Source
      
  
const ( ProtocolName = "tx-submission" ProtocolId uint16 = 4 )
Variables ¶
      View Source
      
  
var StateMap = protocol.StateMap{ // contains filtered or unexported fields }
Functions ¶
Types ¶
type Config ¶
type Config struct {
	RequestTxIdsFunc RequestTxIdsFunc
	ReplyTxIdsFunc   ReplyTxIdsFunc
	RequestTxsFunc   RequestTxsFunc
	ReplyTxsFunc     ReplyTxsFunc
	DoneFunc         DoneFunc
	InitFunc         InitFunc
	IdleTimeout      time.Duration
}
    func NewConfig ¶
func NewConfig(options ...TxSubmissionOptionFunc) Config
type MsgDone ¶
type MsgDone struct {
	protocol.MessageBase
}
    func NewMsgDone ¶
func NewMsgDone() *MsgDone
type MsgInit ¶
type MsgInit struct {
	protocol.MessageBase
}
    func NewMsgInit ¶
func NewMsgInit() *MsgInit
type MsgReplyTxIds ¶
type MsgReplyTxIds struct {
	protocol.MessageBase
	TxIds []TxIdAndSize
}
    func NewMsgReplyTxIds ¶
func NewMsgReplyTxIds(txIds []TxIdAndSize) *MsgReplyTxIds
func (*MsgReplyTxIds) MarshalCBOR ¶ added in v0.53.0
func (m *MsgReplyTxIds) MarshalCBOR() ([]byte, error)
type MsgReplyTxs ¶
type MsgReplyTxs struct {
	protocol.MessageBase
	Txs []TxBody
}
    func NewMsgReplyTxs ¶
func NewMsgReplyTxs(txs []TxBody) *MsgReplyTxs
func (*MsgReplyTxs) MarshalCBOR ¶ added in v0.53.0
func (m *MsgReplyTxs) MarshalCBOR() ([]byte, error)
type MsgRequestTxIds ¶
type MsgRequestTxIds struct {
	protocol.MessageBase
	Blocking bool
	Ack      uint16
	Req      uint16
}
    func NewMsgRequestTxIds ¶
func NewMsgRequestTxIds(blocking bool, ack uint16, req uint16) *MsgRequestTxIds
type MsgRequestTxs ¶
type MsgRequestTxs struct {
	protocol.MessageBase
	TxIds []TxId
}
    func NewMsgRequestTxs ¶
func NewMsgRequestTxs(txIds []TxId) *MsgRequestTxs
type ReplyTxIdsFunc ¶
type ReplyTxIdsFunc func(interface{}) error
    type ReplyTxsFunc ¶
type ReplyTxsFunc func(interface{}) error
    type RequestTxIdsFunc ¶
type RequestTxIdsFunc func(bool, uint16, uint16) ([]TxIdAndSize, error)
Callback function types
type RequestTxsFunc ¶
type TxBody ¶
type TxBody struct {
	cbor.StructAsArray
	EraId  uint16
	TxBody []byte
}
    func (*TxBody) MarshalCBOR ¶ added in v0.53.0
type TxIdAndSize ¶
type TxIdAndSize struct {
	cbor.StructAsArray
	TxId TxId
	Size uint32
}
    type TxSubmission ¶
func New ¶
func New(protoOptions protocol.ProtocolOptions, cfg *Config) *TxSubmission
type TxSubmissionOptionFunc ¶
type TxSubmissionOptionFunc func(*Config)
func WithDoneFunc ¶
func WithDoneFunc(doneFunc DoneFunc) TxSubmissionOptionFunc
func WithIdleTimeout ¶
func WithIdleTimeout(timeout time.Duration) TxSubmissionOptionFunc
func WithInitFunc ¶
func WithInitFunc(initFunc InitFunc) TxSubmissionOptionFunc
func WithReplyTxIdsFunc ¶
func WithReplyTxIdsFunc(replyTxIdsFunc ReplyTxIdsFunc) TxSubmissionOptionFunc
func WithReplyTxsFunc ¶
func WithReplyTxsFunc(replyTxsFunc ReplyTxsFunc) TxSubmissionOptionFunc
func WithRequestTxIdsFunc ¶
func WithRequestTxIdsFunc(requestTxIdsFunc RequestTxIdsFunc) TxSubmissionOptionFunc
func WithRequestTxsFunc ¶
func WithRequestTxsFunc(requestTxsFunc RequestTxsFunc) TxSubmissionOptionFunc
 Click to show internal directories. 
   Click to hide internal directories.