Documentation ¶
Index ¶
- type Bus
- type Context
- func (ctx *Context) CreateNamespace(opts CreateNamespaceOpts) (*Namespace, error)
- func (ctx *Context) DestroyNamespaceByName(name string) error
- func (ctx *Context) Free()
- func (ctx *Context) GetActiveNamespaces() []*Namespace
- func (ctx *Context) GetAllNamespaces() []*Namespace
- func (ctx *Context) GetBuses() []*Bus
- func (ctx *Context) GetNamespaceByName(name string) (*Namespace, error)
- func (ctx *Context) IsSpaceAvailable(size uint64) bool
- type CreateNamespaceOpts
- type Dimm
- type MapLocation
- type Mapping
- type Namespace
- func (ns *Namespace) Active() bool
- func (ns *Namespace) BlockDeviceName() string
- func (ns *Namespace) DeviceName() string
- func (ns *Namespace) Enable() error
- func (ns *Namespace) Enabled() bool
- func (ns *Namespace) ID() uint
- func (ns *Namespace) Location() MapLocation
- func (ns *Namespace) MarshalJSON() ([]byte, error)
- func (ns *Namespace) Mode() NamespaceMode
- func (ns *Namespace) Name() string
- func (ns *Namespace) Region() *Region
- func (ns *Namespace) SetAltName(name string) error
- func (ns *Namespace) SetEnforceMode(mode NamespaceMode) error
- func (ns *Namespace) SetSectorSize(sectorSize uint64) error
- func (ns *Namespace) SetSize(size uint64) error
- func (ns *Namespace) SetUUID(uid uuid.UUID) error
- func (ns *Namespace) Size() uint64
- func (ns *Namespace) Type() NamespaceType
- func (ns *Namespace) UUID() uuid.UUID
- type NamespaceMode
- type NamespaceType
- type Region
- func (r *Region) ActiveNamespaces() []*Namespace
- func (r *Region) AllNamespaces() []*Namespace
- func (r *Region) AvailableSize() uint64
- func (r *Region) Bus() *Bus
- func (r *Region) CreateNamespace(opts CreateNamespaceOpts) (*Namespace, error)
- func (r *Region) DestroyNamespace(ns *Namespace, force bool) error
- func (r *Region) DeviceName() string
- func (r *Region) Enabled() bool
- func (r *Region) ID() uint
- func (r *Region) InterleaveWays() uint64
- func (r *Region) Mappings() []*Mapping
- func (r *Region) MarshalJSON() ([]byte, error)
- func (r *Region) MaxAvailableExtent() uint64
- func (r *Region) Readonly() bool
- func (r *Region) SeedNamespace() *Namespace
- func (r *Region) Size() uint64
- func (r *Region) Type() RegionType
- func (r *Region) TypeName() string
- type RegionType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bus ¶
type Bus C.struct_ndctl_bus
Bus go wrapper for ndctl_bus
func (*Bus) ActiveRegions ¶
ActiveRegions returns all active regions in the bus
func (*Bus) AllRegions ¶
AllRegions returns all regions in the bus including disabled regions
func (*Bus) GetRegionByPhysicalAddress ¶
GetRegionByPhysicalAddress Find region by physical address
func (*Bus) MarshalJSON ¶
MarshalJSON returns the encoded value of bus
type Context ¶
type Context C.struct_ndctl_ctx
Context go wrapper for ndctl context
func (*Context) CreateNamespace ¶
func (ctx *Context) CreateNamespace(opts CreateNamespaceOpts) (*Namespace, error)
CreateNamespace create new namespace with given opts
func (*Context) DestroyNamespaceByName ¶
DestroyNamespaceByName deletes namespace with given name
func (*Context) GetActiveNamespaces ¶
GetActiveNamespaces returns list of all active namespaces in all regions
func (*Context) GetAllNamespaces ¶
GetAllNamespaces returns list of all namespaces in all regions including idle namespaces
func (*Context) GetNamespaceByName ¶
GetNamespaceByName gets namespace details for given name
func (*Context) IsSpaceAvailable ¶
IsSpaceAvailable checks if a region available with given free size
type CreateNamespaceOpts ¶
type CreateNamespaceOpts struct { Name string Size uint64 SectorSize uint64 Align uint64 Type NamespaceType Mode NamespaceMode Location MapLocation }
CreateNamespaceOpts options to create a namespace
type Dimm ¶
type Dimm C.struct_ndctl_dimm
Dimm go wrapper for ndctl_dimm
func (*Dimm) MarshalJSON ¶
MarshalJSON returns the encoding of dimm
type MapLocation ¶
type MapLocation string
const ( MemoryMap MapLocation = "mem" // RAM DeviceMap MapLocation = "dev" // Block Device NoneMap MapLocation = "none" )
type Mapping ¶
type Mapping C.struct_ndctl_mapping
Mapping go wrapper for ndctl_mapping
func (*Mapping) MarshalJSON ¶
MarshalJSON returns json encoding of the mapping
type Namespace ¶
type Namespace C.struct_ndctl_namespace
Namespace go wrapper for ndctl_namespace
func (*Namespace) BlockDeviceName ¶
BlockDeviceName return namespace block device name
func (*Namespace) DeviceName ¶
DeviceName returns namespace device name
func (*Namespace) Location ¶
func (ns *Namespace) Location() MapLocation
Location returns namespace mapping location
func (*Namespace) MarshalJSON ¶
MarshalJSON returns json encoding of namespace
func (*Namespace) SetAltName ¶
func (*Namespace) SetEnforceMode ¶
func (ns *Namespace) SetEnforceMode(mode NamespaceMode) error
func (*Namespace) SetSectorSize ¶
type NamespaceMode ¶
type NamespaceMode string
NamespaceMode represents mode of the namespace
const ( DaxMode NamespaceMode = "dax" //DevDax FsdaxMode NamespaceMode = "fsdax" //Memory RawMode NamespaceMode = "raw" SectorMode NamespaceMode = "sector" UnknownMode NamespaceMode = "unknown" )
type NamespaceType ¶
type NamespaceType string
NamespaceType type to represent namespace type
const ( //PmemNamespace pmem type namespace PmemNamespace NamespaceType = "pmem" //BlockNamespace block type namespace BlockNamespace NamespaceType = "blk" //IoNamespace io type namespace IoNamespace NamespaceType = "io" //UnknownType unknown namespace UnknownType NamespaceType = "unknown" )
type Region ¶
type Region C.struct_ndctl_region
Region go wrapper for ndctl_region
func (*Region) ActiveNamespaces ¶
ActiveNamespaces returns all active namespaces in the region
func (*Region) AllNamespaces ¶
AllNamespaces returns all namespaces in the region
func (*Region) AvailableSize ¶
AvailableSize returns size available in the region
func (*Region) CreateNamespace ¶
func (r *Region) CreateNamespace(opts CreateNamespaceOpts) (*Namespace, error)
func (*Region) DestroyNamespace ¶
DestroyNamespace destroys the given namespace ns in the region
func (*Region) InterleaveWays ¶ added in v0.5.0
func (*Region) MarshalJSON ¶
MarshalJSON returns json encoding of the region
func (*Region) MaxAvailableExtent ¶
MaxAvailableExtent returns max available extent size in the region
func (*Region) SeedNamespace ¶
func (*Region) Type ¶
func (r *Region) Type() RegionType
type RegionType ¶
type RegionType string
const ( PmemRegion RegionType = "pmem" //C.ND_DEVICE_REGION_PMEM BlockRegion RegionType = "blk" //C.ND_DEVICE_REGION_BLK UnknownRegion RegionType = "unknown" )