Documentation
¶
Index ¶
Constants ¶
View Source
const ( ControlSize = 4096 // 1 page Magic = 0x4C455943 // 'LEYC' )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct {
Magic uint32
Version uint32
Generation uint64 // Atomic
ArenaPath [256]byte
ArenaSize uint64
Padding [ControlSize - 272]byte // Pad to 4096 bytes
}
Block represents the memory-mapped control file. It must match the C layout exactly for interoperability.
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller manages the memory-mapped control file.
func OpenOrCreate ¶
func OpenOrCreate(path string) (*Controller, error)
OpenOrCreate opens or creates a control file at the given path.
func (*Controller) Close ¶
func (c *Controller) Close() error
Close unmaps and closes the control file.
func (*Controller) GetArenaPath ¶
func (c *Controller) GetArenaPath() string
GetArenaPath returns the path to the currently active arena.
func (*Controller) GetGeneration ¶
func (c *Controller) GetGeneration() uint64
GetGeneration returns the current generation ID atomically.
Click to show internal directories.
Click to hide internal directories.