Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Merovius/nbd
/ functions
Functions
140 in github.com/Merovius/nbd
⨍
Functions
140
◇
Types & classes
38
↓ 17 callers
Method
writeUint32
(v uint32)
handshake.go:417
↓ 15 callers
Method
uint32
()
handshake.go:399
↓ 13 callers
Method
Close
Close implements io.Closer. It cleans up the resources associated with the ctxRW, but not the wrapped net.Conn. The wrapped net.Conn must be closed by
transmission.go:213
↓ 13 callers
Method
read
(b []byte)
handshake.go:374
↓ 13 callers
Method
writeUint16
(v uint16)
handshake.go:411
↓ 11 callers
Function
encodeReply
(e *encoder, option uint32, reply optionReply)
types.go:206
↓ 10 callers
Method
uint64
()
handshake.go:405
↓ 10 callers
Method
writeUint64
(v uint64)
handshake.go:423
↓ 9 callers
Method
uint16
()
handshake.go:393
↓ 8 callers
Function
respondErr
respondErr writes an error respons to e, based on handle an err.
transmission.go:153
↓ 8 callers
Method
write
(b []byte)
handshake.go:351
↓ 6 callers
Function
do
do wraps rw for easy en-/decoding of binary data. It creates an *encoder and calls f with that. The process uses panic/recover for error handling, so
handshake.go:323
↓ 5 callers
Method
Execute
(ctx context.Context, fs *flag.FlagSet, _ ...interface{})
cmd/nbd/lo.go:64
↓ 5 callers
Method
encode
(*encoder)
types.go:202
↓ 5 callers
Method
writeString
(s string)
handshake.go:360
↓ 4 callers
Method
decode
(*encoder, uint32)
types.go:203
↓ 4 callers
Function
dial
dial initalizes conn, if needed.
nbdnl/nbd.go:85
↓ 3 callers
Function
ListenAndServe
ListenAndServe starts listening on the given network/address and serves the given exports, the first of which will serve as the default. It starts a n
transmission.go:50
↓ 3 callers
Method
discard
(n uint32)
handshake.go:382
↓ 3 callers
Method
recv
recv receives an option reply from the server.
handshake.go:178
↓ 3 callers
Method
send
send sends an option request to the server.
handshake.go:165
↓ 2 callers
Function
Configure
Configure passes the given set of sockets to the kernel to provide them as an NBD device. socks must be connected to the same server (which must suppo
netlink.go:38
↓ 2 callers
Function
Disconnect
Disconnect instructs the kernel to disconnect the given device.
nbdnl/nbd.go:274
↓ 2 callers
Method
Error
()
transmission.go:30
↓ 2 callers
Method
Go
Go terminates the handshake phase of the NBD protocol, opening the export identified by exportName. If exportName is the empty string, the default exp
handshake.go:291
↓ 2 callers
Method
Write
Write implements io.Writer. It returns context.Cause(ctx) if the write was aborted due to context cancellation.
transmission.go:201
↓ 2 callers
Method
checkClosed
(e *encoder)
handshake.go:158
↓ 2 callers
Method
close
close marks the Client closed, preventing it from further use, and cleans up the connection wrapper. It does not close the wrapped connection.
handshake.go:299
↓ 2 callers
Method
code
()
types.go:201
↓ 2 callers
Function
encodeSockList
(l []uint32)
nbdnl/nbd.go:298
↓ 2 callers
Function
findExport
findExport searches the list of exports for one with the given name. If name is empty, it returns the first export. findExport performs a linear searc
handshake.go:308
↓ 2 callers
Method
info
into sends an NBD_OPT_INFO (if done == false) or NBD_OPT_GO (if done == true) request and returns the export data returned by the server.
handshake.go:247
↓ 2 callers
Function
serve
serve serves nbd requests for a connection in transmission mode using p. It returns after ctx is cancelled or an error occurs.
transmission.go:98
↓ 2 callers
Function
status
(idx uint32)
nbdnl/nbd.go:340
↓ 2 callers
Function
wrapConn
wrapConn wraps a connection in a ctxRW.
transmission.go:177
↓ 1 callers
Function
ClientHandshake
ClientHandshake starts the client-side of the NBD handshake over c.
handshake.go:140
↓ 1 callers
Function
Connect
Connect instructs the kernel to connect the given set of sockets to the given NBD device number. socks must be NBD connections in transmission mode. c
nbdnl/nbd.go:171
↓ 1 callers
Method
Errno
()
transmission.go:31
↓ 1 callers
Function
Errorf
Errorf returns an error implementing Error, returning code from Errno.
types.go:465
↓ 1 callers
Function
Loopback
Loopback serves d on a private socket, passing the other end to the kernel to connect to an NBD device. It returns the device-number that the kernel c
netlink.go:54
↓ 1 callers
Function
Serve
Serve serves the given exports on c. The first export is used as a default. Serve returns after ctx is cancelled or an error occurs.
transmission.go:88
↓ 1 callers
Function
StatusAll
StatusAll lists all NBD devices and their corresponding status.
nbdnl/nbd.go:332
↓ 1 callers
Method
String
()
types.go:175
↓ 1 callers
Method
Sync
Sync should block until all previous writes where written to persistent storage and return any errors that occured.
transmission.go:42
↓ 1 callers
Method
Usage
()
cmd/nbd/connect.go:51
↓ 1 callers
Method
Usage
()
cmd/nbd/lo.go:47
↓ 1 callers
Method
Usage
()
cmd/nbd/serve.go:47
↓ 1 callers
Function
WithBlockSize
WithBlockSize sets the block size used by the client to n.
nbdnl/nbd.go:114
↓ 1 callers
Method
WriteAt
(p []byte, offset int64)
cmd/nbd/lo.go:122
↓ 1 callers
Function
blockSize
(fi os.FileInfo)
cmd/nbd/stat_unix.go:26
↓ 1 callers
Method
decode
(e *encoder)
types.go:511
↓ 1 callers
Function
decodeDeviceList
(b []byte)
nbdnl/nbd.go:395
↓ 1 callers
Function
decodeDeviceListItem
(b []byte)
nbdnl/nbd.go:417
↓ 1 callers
Function
decodeInfo
(e *encoder, l uint32)
types.go:270
↓ 1 callers
Function
decodeOption
(e *encoder)
types.go:42
↓ 1 callers
Method
encode
(e *encoder)
types.go:544
↓ 1 callers
Function
serverHandshake
(rw io.ReadWriter, exp []Export)
handshake.go:51
↓ 1 callers
Method
toggleCrash
()
cmd/nbd/lo.go:114
Method
Abort
Abort aborts the handshake. c should not be used after Abort returns.
handshake.go:212
Method
Errno
Errno returns e.
types.go:451
Method
Errno
()
types.go:460
Method
Error
()
types.go:396
Method
Error
()
types.go:443
Method
Execute
(ctx context.Context, fs *flag.FlagSet, _ ...interface{})
cmd/nbd/disc.go:57
Method
Execute
(ctx context.Context, fs *flag.FlagSet, _ ...interface{})
cmd/nbd/connect.go:64
Method
Execute
(ctx context.Context, fs *flag.FlagSet, _ ...interface{})
cmd/nbd/serve.go:59
Method
Execute
(ctx context.Context, fs *flag.FlagSet, _ ...interface{})
cmd/nbd/list.go:57
Method
Info
Info requests information about the export identified by exportName. If exportName is the empty string, the default export will be queried.
handshake.go:284
Method
List
List returns the names of exports the server is providing.
handshake.go:226
Method
Name
()
cmd/nbd/disc.go:36
Method
Name
()
cmd/nbd/connect.go:43
Method
Name
()
cmd/nbd/lo.go:39
Method
Name
()
cmd/nbd/serve.go:39
Method
Name
()
cmd/nbd/list.go:39
Method
Read
Read implements io.Reader. It returns context.Cause(ctx) if the read was aborted due to context cancellation.
transmission.go:191
Function
Reconfigure
Reconfigure reconfigures the given device. The arguments are equivalent to Configure, except that IndexAny is invalid for Reconfigure and WithBlockSiz
nbdnl/nbd.go:235
Method
Set
(s string)
cmd/nbd/nbd.go:56
Method
SetFlags
(fs *flag.FlagSet)
cmd/nbd/disc.go:52
Method
SetFlags
(fs *flag.FlagSet)
cmd/nbd/connect.go:58
Method
SetFlags
(fs *flag.FlagSet)
cmd/nbd/lo.go:62
Method
SetFlags
(fs *flag.FlagSet)
cmd/nbd/serve.go:54
Method
SetFlags
(fs *flag.FlagSet)
cmd/nbd/list.go:54
Function
Status
Status returns the status of the given NBD device.
nbdnl/nbd.go:317
Method
String
()
cmd/nbd/nbd.go:46
Method
Synopsis
()
cmd/nbd/disc.go:40
Method
Synopsis
()
cmd/nbd/connect.go:47
Method
Synopsis
()
cmd/nbd/lo.go:43
Method
Synopsis
()
cmd/nbd/serve.go:43
Method
Synopsis
()
cmd/nbd/list.go:43
Function
TestListenAndServeContextCancel
(t *testing.T)
transmission_test.go:10
Function
TestListenAndServeContextNoCancel
(t *testing.T)
transmission_test.go:42
Method
Usage
()
cmd/nbd/disc.go:44
Method
Usage
()
cmd/nbd/list.go:47
Function
WithDeadconnTimeout
WithDeadconnTimeout sets the timeout after which the client considers a server unreachable to d.
nbdnl/nbd.go:129
Function
WithTimeout
WithTimeout sets the read-timeout for the NBD client to d.
nbdnl/nbd.go:121
Function
blockSize
(fi os.FileInfo)
cmd/nbd/stat_other.go:25
Method
code
()
types.go:39
Method
code
()
types.go:96
Method
code
()
types.go:109
Method
code
()
types.go:126
next →
1–100 of 140, ranked by callers