Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrClosed = errors.New("transport already closed")
Functions ¶
func BufferCommands ¶
BufferCommands buffers command packets written to the returned writer and writes complete packets to the supplied writer in a single write. The maxCommandSize argument defines the maximum size of a command.
func BufferResponses ¶
BufferResponses reads complete response packets from the supplied reader in a single read and makes them available to the returned reader for partial reading. The maxResponseSize argument defines the size of the read on the supplied reader.
func NewRetrierTransport ¶
func NewRetrierTransport(transport tpm2.Transport, params RetryParams) tpm2.Transport
NewRetrierTransport returns a new transport that resubmits commands on certain errors, which is necessary for transports that don't already do this.
Types ¶
type RetryParams ¶
type RetryParams struct { // MaxRetries is the maximum number of times a command is retried. MaxRetries uint // InitialBackoff is the amount of time to wait before submitting the // first retry. InitialBackoff time.Duration // BackoffRate determines how much more time to wait before submitting // each subsequent retry. Eg, if InitialBackoff is 20ms and this field // is 2, the first retry will be attempted after a delay of 20ms, then // the next retry after 40ms, then 80ms etc. BackoffRate uint }
Click to show internal directories.
Click to hide internal directories.