shm

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: MIT Imports: 4 Imported by: 0

README

shm

Go Reference Build Status Go Report Card codecov

About

shm is a Go (golang) wrapper for SysV Shared Memory Segments

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorGivenSliceBiggerThanData = fmt.Errorf("shm: p is larger than SharedMemory size")
View Source
var ErrorGivenSliceTooBig = fmt.Errorf("shm: slice of bytes provided too big to write")

Functions

This section is empty.

Types

type SharedMemory

type SharedMemory struct {
	// contains filtered or unexported fields
}

SharedMemory is a Wrapper around SysVShm, and is not safe for concurrent access

func New

func New(id int, size int) SharedMemory

New SharedMemory using id, if id is 0, make one there

func (*SharedMemory) Close

func (sm *SharedMemory) Close() error

Close *MUST* be called after SharedMemory is finished being used

func (*SharedMemory) ID

func (sm *SharedMemory) ID() int

func (*SharedMemory) Open

func (sm *SharedMemory) Open() error

Open the SharedMemory (shm) segment, will return nil if called while already open

func (*SharedMemory) Read

func (sm *SharedMemory) Read(p []byte) (n int, err error)

func (*SharedMemory) ReadAt

func (sm *SharedMemory) ReadAt(p []byte, off int64) (n int, err error)

func (*SharedMemory) Size

func (sm *SharedMemory) Size() int

func (*SharedMemory) Write

func (sm *SharedMemory) Write(p []byte) (n int, err error)

func (*SharedMemory) WriteAt

func (sm *SharedMemory) WriteAt(p []byte, off int64) (n int, err error)

Directories

Path Synopsis
internal
multierror
Package multierror contains a Multierror for combining multiple errors and compiling with errors.Is
Package multierror contains a Multierror for combining multiple errors and compiling with errors.Is

Jump to

Keyboard shortcuts

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