devutil

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0, MIT Imports: 7 Imported by: 0

Documentation

Overview

Package devutil provides device specific utilities.

Index

Constants

View Source
const (
	// CtxDevGoferClient is a Context.Value key for a /dev gofer client.
	CtxDevGoferClient contextID = iota
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GoferClient

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

GoferClient is the lisafs client for the /dev gofer connection.

func GoferClientFromContext

func GoferClientFromContext(ctx context.Context) *GoferClient

GoferClientFromContext returns the device gofer client used by ctx.

func NewGoferClient

func NewGoferClient(ctx context.Context, fd int) (*GoferClient, error)

NewGoferClient establishes the LISAFS connection to the dev gofer server. It takes ownership of fd.

func (*GoferClient) Close

func (g *GoferClient) Close()

Close closes the LISAFS connection.

func (*GoferClient) DirentNames

func (g *GoferClient) DirentNames(ctx context.Context) ([]string, error)

DirentNames returns names of all the dirents for /dev on the gofer.

func (*GoferClient) OpenAt

func (g *GoferClient) OpenAt(ctx context.Context, name string, flags uint32) (int, error)

OpenAt opens the device file at /dev/{name} on the gofer.

Jump to

Keyboard shortcuts

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