iscsi

package module
v0.0.0-...-a9021d6 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: MIT Imports: 18 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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")

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(ctx context.Context, dev *device) (*reader, error)

func SetLogger

func SetLogger(l *slog.Logger)

func Writer

func Writer(ctx context.Context, dev *device) (*writer, error)

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
connect command
drivefiller command
example command

Jump to

Keyboard shortcuts

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