platform

package
v1.127.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

package platform provides platform specific code for the hashstore.

Index

Constants

View Source
const FlockSupported = true

FlockSupported is a constant indicating if flock is supported on the platform.

Variables

View Source
var Error = errs.Class("platform")

Error wraps errors returned by this package.

Functions

func CreateFile

func CreateFile(path string) (*os.File, error)

CreateFile creates a file in read/write mode that errors if it already exists.

func Fallocate

func Fallocate(fh *os.File, size int64) error

Fallocate preallocates space for a file. It is a no-op on platforms that do not support it.

func Flock

func Flock(fh *os.File) error

Flock attempts to flock the file if flock is supported on the platform.

func MMAP

func MMAP(fh *os.File, size int) ([]byte, func() error, error)

MMAP maps size bytes of the file into memory returning the byte slice and a function to close the mapping.

Types

This section is empty.

Jump to

Keyboard shortcuts

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