io

package
v0.0.80 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

Package io is the input/output package

Index

Constants

View Source
const (
	SeekStart   = io.SeekStart
	SeekCurrent = io.SeekCurrent
	SeekEnd     = io.SeekEnd
)
View Source
const (
	ErrFileSize       = errors.String("file Size is zero")
	ErrFileType       = errors.String("file type is not supported")
	ErrTargetIsNotDir = errors.String("target is not a directory")
	ErrFileRead       = errors.String("file read error")
	ErrFileWrite      = errors.String("file write error")
	ErrFileNotExist   = errors.String("file not exist")
	ErrFileName       = errors.String("file Path is empty")
	ErrSizeNotMatch   = errors.String("file Size not match")
)

Variables

View Source
var (
	EOF              = io.EOF
	ErrNoProgress    = io.ErrNoProgress
	ErrUnexpectedEOF = io.ErrUnexpectedEOF
	ErrShortBuffer   = io.ErrShortBuffer
	ErrShortWrite    = io.ErrShortWrite
)
View Source
var (
	Discard        = io.Discard
	StdWriteString = io.WriteString
	StdCopy        = io.Copy
	StdCopyBuffer  = io.CopyBuffer
	StdCopyN       = io.CopyN
	StdLimitReader = io.LimitReader
	StdReadAll     = io.ReadAll
	StdReadFull    = io.ReadFull
	StdReadAtLeast = io.ReadAtLeast
	StdMultiReader = io.MultiReader
	StdMultiWriter = io.MultiWriter
	StdNopCloser   = io.NopCloser
	StdPipe        = io.Pipe
)

Functions

func CopyContext added in v0.0.53

func CopyContext(ctx context.Context, dst io.Writer, src io.Reader) (int64, error)

CopyContext copy data from src to dst until EOF or error, returning the number of bytes copied.

func DeleteFile

func DeleteFile(path string) error

DeleteFile deletes files related to the provided id and param.

func ReadBuffer

func ReadBuffer(path string, buf *bytes.Buffer) (int64, error)

ReadBuffer read file to buffer

Types

type ByteReader

type ByteReader = io.ByteReader

type ByteScanner

type ByteScanner = io.ByteScanner

type ByteWriter

type ByteWriter = io.ByteWriter

type Closer

type Closer = io.Closer

type FileInfo

type FileInfo = fs.FileInfo

type OffsetWriter

type OffsetWriter = io.OffsetWriter

type ReadCloser

type ReadCloser = io.ReadCloser

type ReadSeekCloser

type ReadSeekCloser = io.ReadSeekCloser

type ReadSeeker

type ReadSeeker = io.ReadSeeker

type ReadWriteCloser

type ReadWriteCloser = io.ReadWriteCloser

type ReadWriteSeeker

type ReadWriteSeeker = io.ReadWriteSeeker

type Reader

type Reader = io.Reader

type ReaderAt

type ReaderAt = io.ReaderAt

type ReaderFrom

type ReaderFrom = io.ReaderFrom

type RuneReader

type RuneReader = io.RuneReader

type RuneScanner

type RuneScanner = io.RuneScanner

type SectionReader

type SectionReader = io.SectionReader

type Seeker

type Seeker = io.Seeker

type WriteCloser

type WriteCloser = io.WriteCloser

type Writer

type Writer = io.Writer

type WriterAt

type WriterAt = io.WriterAt

type WriterTo

type WriterTo = io.WriterTo

Jump to

Keyboard shortcuts

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