Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrClientClosed returned when client do something when // it already closed ErrClientClosed = errors.New("client already closed") // ErrWaitSlaveSyncTimeout returned when nbd slave sync couldn't be finished ErrWaitSlaveSyncTimeout = errors.New("wait nbd slave sync timed out") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client defines a Tlog Client. This client is not thread/goroutine safe.
func New ¶
New creates a new tlog client for a vdisk with 'addr' is the tlogserver address. 'firstSequence' is the first sequence number this client is going to send. Set 'resetFirstSeq' to true to force reset the vdisk first/expected sequence. The client is not goroutine safe.
func (*Client) Close ¶
Close the open connection, making this client invalid. It is user responsibility to call this function.
func (*Client) ForceFlushAtSeq ¶
ForceFlushAtSeq force flush at given sequence
func (*Client) Send ¶
Send sends the transaction tlog to server. It returns error in these cases: - failed to encode the capnp. - failed to recover from broken network connection.
func (*Client) WaitNbdSlaveSync ¶
WaitNbdSlaveSync commands tlog server to wait for nbd slave to be fully synced
type Response ¶
type Response struct { Status tlog.BlockStatus // status of the call Sequences []uint64 // flushed sequences number (optional) }
Response defines a response from tlog server