Documentation ¶
Index ¶
- func RegisterProvider(id string, createFunc InitFunc) error
- func TestTarget(t *testing.T, target Target)
- type Completer
- type Executer
- type Factory
- type FileTarget
- type Handler
- type IORequest
- func (r *IORequest) AddBuffer(buffer []byte)
- func (r *IORequest) Assert() error
- func (r *IORequest) Buffers() []SGE
- func (r *IORequest) Complete(status TargetError) TargetError
- func (r *IORequest) Init(c TargetCommand, lba uint64, length uint32, completion Completer) *IORequest
- func (r *IORequest) SetExecuter(e Executer)
- func (r *IORequest) Start()
- type InitFunc
- type KV
- type MemTarget
- type NullTarget
- type Options
- type SGE
- type SleepyTarget
- type Target
- type TargetCommand
- type TargetError
- type TestCompleter
- type TestableMediaRegion
- type TestableTarget
- type WorkQueue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterProvider ¶
func TestTarget ¶
Types ¶
type Completer ¶
type Completer func(status TargetError)
type FileTarget ¶
FileTarget implements target that write to file image
func (*FileTarget) Close ¶
func (t *FileTarget) Close() error
func (*FileTarget) GetRuntimeDetails ¶
func (t *FileTarget) GetRuntimeDetails() []KV
func (*FileTarget) GetSize ¶
func (t *FileTarget) GetSize() uint64
func (*FileTarget) Queue ¶
func (t *FileTarget) Queue(r *IORequest) TargetError
func (*FileTarget) Start ¶
func (t *FileTarget) Start() error
type IORequest ¶
type IORequest struct { Command TargetCommand Lba uint64 Length uint32 SGL [16]SGE SGLC int ExecuteRequest Executer CompleteRequest Completer }
func (*IORequest) Complete ¶
func (r *IORequest) Complete(status TargetError) TargetError
func (*IORequest) SetExecuter ¶
type MemTarget ¶
type MemTarget struct {
Buffer []byte
}
MemTarget implements target that write to file image
func (*MemTarget) GetRuntimeDetails ¶
func (*MemTarget) Queue ¶
func (t *MemTarget) Queue(r *IORequest) TargetError
type NullTarget ¶
type NullTarget struct {
Size uint64
}
func NewNullTarget ¶
func NewNullTarget(options Options) *NullTarget
func (*NullTarget) Close ¶
func (t *NullTarget) Close() error
func (*NullTarget) GetRuntimeDetails ¶
func (t *NullTarget) GetRuntimeDetails() []KV
func (*NullTarget) GetSize ¶
func (t *NullTarget) GetSize() uint64
func (*NullTarget) Queue ¶
func (t *NullTarget) Queue(r *IORequest) TargetError
func (*NullTarget) Start ¶
func (t *NullTarget) Start() error
type SleepyTarget ¶
func (*SleepyTarget) Close ¶
func (t *SleepyTarget) Close() error
func (*SleepyTarget) GetRuntimeDetails ¶
func (t *SleepyTarget) GetRuntimeDetails() []KV
func (*SleepyTarget) GetSize ¶
func (t *SleepyTarget) GetSize() uint64
func (*SleepyTarget) Queue ¶
func (t *SleepyTarget) Queue(r *IORequest) TargetError
func (*SleepyTarget) Start ¶
func (t *SleepyTarget) Start() error
type Target ¶
type Target interface { // Start performs any required initialization of the target Start() error // Queue enqueue the request for processing Queue(r *IORequest) TargetError // GetSize the current size (in bytes) of the target GetSize() uint64 // Close terminates any background tasks the target m ay be doing Close() error // GetRuntimeDetails returns internal configuration information about the target GetRuntimeDetails() []KV }
func FILECreateTarget ¶
func MEMCreateTarget ¶
func SleepyCreateTarget ¶
type TargetCommand ¶
type TargetCommand uint8
const ( IORequestCmdRead TargetCommand = 0x1 IORequestCmdWrite TargetCommand = 0x2 IORequestCmdTrim TargetCommand = 0x3 IORequestCmdWriteZero TargetCommand = 0x4 IORequestCmdFlush TargetCommand = 0x5 IORequestSnapshot TargetCommand = 0x20 )
type TargetError ¶
type TargetError uint16
const ( TargetErrorNone TargetError = 0x0 TargetErrorUnsupported TargetError = 0x1 TargetErrorAborted TargetError = 0x3 TargetErrorLbaOutOfRange TargetError = 0x4 TargetErrorWrite TargetError = 0x5 TargetErrorRead TargetError = 0x6 TargetErrorInternal TargetError = 0xffff )
func TestRequest ¶
func TestRequest(t Target, r *IORequest) TargetError
type TestCompleter ¶
func (*TestCompleter) Complete ¶
func (t *TestCompleter) Complete(status TargetError)
type TestableMediaRegion ¶
type TestableTarget ¶
type TestableTarget struct { SleepTime time.Duration ReadCount uint64 WriteCount uint64 TrimCount uint64 ZeroCount uint64 FlushCount uint64 Buffer []byte Regions []TestableMediaRegion }
func NewTestableTarget ¶
func NewTestableTarget(options Options) *TestableTarget
func (*TestableTarget) Close ¶
func (t *TestableTarget) Close() error
func (*TestableTarget) GetRuntimeDetails ¶
func (t *TestableTarget) GetRuntimeDetails() []KV
func (*TestableTarget) GetSize ¶
func (t *TestableTarget) GetSize() uint64
func (*TestableTarget) Queue ¶
func (t *TestableTarget) Queue(r *IORequest) TargetError
func (*TestableTarget) Start ¶
func (t *TestableTarget) Start() error
type WorkQueue ¶
type WorkQueue struct { Handler Target // contains filtered or unexported fields }
func (*WorkQueue) GetRuntimeDetails ¶
func (*WorkQueue) Queue ¶
func (w *WorkQueue) Queue(r *IORequest) TargetError
Click to show internal directories.
Click to hide internal directories.