ioutils

package module
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: BSD-3-Clause Imports: 11 Imported by: 5

README

go-ioutils

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMaximumSize = errors.New("maximum buffer size reached")
	ErrInvalidSize = errors.New("invalid size")
)

Functions

func Copy

func Copy(dst, src string, mode os.FileMode) error

func CurrentDir

func CurrentDir() string

func Exist

func Exist(filename string) bool

func FileHash

func FileHash(filename string, h hash.Hash) (string, error)

func Folder

func Folder(filename string) string

func IsAsciiEOF

func IsAsciiEOF(b []byte) bool

func IsValidFileHash

func IsValidFileHash(filename string, h hash.Hash, valid string) error

func ReadAll

func ReadAll(r io.ReadCloser) ([]byte, error)

func ReadBytes

func ReadBytes(v io.Reader, divide string) ([]byte, error)

func ReadFull

func ReadFull(w io.Writer, r io.Reader, maxSize int) error

func Rewrite

func Rewrite(filename string, call func([]byte) ([]byte, error)) error
func Search(dir, filename string) ([]string, error)

func SearchByExt

func SearchByExt(dir, ext string) ([]string, error)

func WriteBytes

func WriteBytes(v io.Writer, b []byte, divide string) error

Types

type Pool

type Pool[T TPool] struct {
	// contains filtered or unexported fields
}

func NewPool

func NewPool[T TPool](callNew func() T) *Pool[T]

func NewSlicePool

func NewSlicePool[T any](l, c int) *Pool[*SlicePool[T]]

func (*Pool[T]) Get

func (v *Pool[T]) Get() T

func (*Pool[T]) Put

func (v *Pool[T]) Put(t T)

type SlicePool

type SlicePool[T any] struct {
	B []T
}

func (*SlicePool[T]) Reset

func (v *SlicePool[T]) Reset()

type TPool

type TPool interface {
	Reset()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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