iscsi

package module
v0.0.0-...-285938f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2025 License: MIT Imports: 17 Imported by: 0

README

Ideas

  • Completely fill a volume with random data
  • write marker values to each lba of a volume
  • io.Reader/io.Writer backed by iscsi
    • how does the block limit affect this? write would have to write a partially empty block and be able to keep track of where to resume writing.

TODO

  • build a binary cross-platform for linux

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDeviceClosed = errors.New("device is closed")

ErrDeviceClosed indicates that an operation cannot be performed because the device has been closed.

Functions

func New

func New(details ConnectionDetails) *device

Creates a new ISCSI device with the given connection details Note that an ISCSI device is not safe to use from multiple goroutines

func Reader

func Reader(dev *device) (*reader, error)

Reader implements io.Reader, io.ReaderAt, io.Closer, and io.Seeker for an underlying ISCSI device. The device must be already connected.

func SetLogger

func SetLogger(l *slog.Logger)

func Writer

func Writer(dev *device) (*writer, error)

Writer implements io.Writer, io.WriterAt, io.Closer, and io.Seeker for an underlying ISCSI device. The device must be already connected.

Types

type Capacity

type Capacity struct {
	// the maximum addressable block in the device
	MaxLBA    int
	BlockSize int
}

type ConnectionDetails

type ConnectionDetails struct {
	InitiatorIQN string
	TargetURL    string
}

type Read16

type Read16 struct {
	LBA       int
	Blocks    int
	BlockSize int
}

type Task

type Task struct {
	Status int
	DataIn []byte
}

Don't want to expose C structs to callers and can't embed C structs in a Go struct so we need getters

type TaskResult

type TaskResult struct {
	Task    Task
	Err     error
	Context any
}

type Write16

type Write16 struct {
	LBA       int
	Data      []byte
	BlockSize int
}

Directories

Path Synopsis
cmd
drivefiller command
example command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL