device

package
v9.4.10+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEnospc is returned if no devices can be allocated.
	ErrEnospc = errors.New("No free device IDs")
	// ErrEinval is returned if a device string is invalid
	ErrEinval = errors.New("Invalid device")
)

Functions

This section is empty.

Types

type Ops

type Ops interface {
	// String representation of the mount table
	String() string
	// Assigns new path
	Assign() (string, error)
	// Releases path to available devices
	Release(device string) error
}

Ops defines the interface to keep track of attached devices.

type SingleLetter

type SingleLetter struct {
	sync.Mutex
	// contains filtered or unexported fields
}

SingleLetter defines a new device letter

func NewSingleLetter

func NewSingleLetter(devPrefix, devices string) (*SingleLetter, error)

NewSingleLetter instance of Matrix

func (*SingleLetter) Assign

func (s *SingleLetter) Assign() (string, error)

Assign new device letter

func (*SingleLetter) Release

func (s *SingleLetter) Release(dev string) error

Release device letter to devices pool.

func (*SingleLetter) String

func (s *SingleLetter) String() string

String is a description of this device.

Jump to

Keyboard shortcuts

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