io

package
v2.4.7 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: Apache-2.0 Imports: 6 Imported by: 38

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NopCloser = NewCloser(func() error {
		return nil
	})
)

Functions

func Close

func Close(c Closer)

Close is a convenience function to close a object that has a Close() method, ignoring any errors Used to satisfy errcheck lint

func NewByteReadSeeker added in v2.1.1

func NewByteReadSeeker(data []byte) *byteReadSeeker

func NewComposableFS added in v2.1.1

func NewComposableFS(innerFS ...fs.FS) *composableFS

NewComposableFS creates files system that attempts reading file from multiple wrapped file systems

func NewSubDirFS added in v2.1.1

func NewSubDirFS(dir string, fs fs.FS) *subDirFs

NewSubDirFS returns file system that represents sub-directory in a wrapped file system

Types

type Closer

type Closer interface {
	Close() error
}

func NewCloser

func NewCloser(close func() error) Closer

type TempPaths added in v2.3.0

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

TempPaths allows generating and memoizing random paths, each path being mapped to a specific key.

func NewTempPaths added in v2.3.0

func NewTempPaths(root string) *TempPaths

func (*TempPaths) Add added in v2.3.0

func (p *TempPaths) Add(key string, value string)

func (*TempPaths) GetPath added in v2.3.0

func (p *TempPaths) GetPath(key string) (string, error)

GetPath generates a path for the given key or returns previously generated one.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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