file

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCompressedFile

func IsCompressedFile(path string) bool

IsCompressedFile does the file is exist and is valid compressed file

func IsDirExist

func IsDirExist(path string) bool

IsDirExist does the directory is existed in this path

func IsFileExist

func IsFileExist(path string) bool

IsFileExist does the file is existed in this path

func ReadFileToBase64

func ReadFileToBase64(path string) string

ReadFileToBase64 read a file and trans the context to base64

func ReadFileToBytes

func ReadFileToBytes(path string) []byte

ReadFileToBytes read a file and trans the context to bytes

Types

type FakeFile

type FakeFile struct{}

FakeFile for unit test

func (FakeFile) Close

func (f FakeFile) Close() error

Close for fake method

func (FakeFile) Read

func (f FakeFile) Read(_ []byte) (int, error)

Read for fake method

func (FakeFile) ReadAt

func (f FakeFile) ReadAt(_ []byte, _ int64) (int, error)

ReadAt for fake method

func (FakeFile) Seek

func (f FakeFile) Seek(_ int64, _ int) (int64, error)

Seek for fake method

type FakeFileInfo

type FakeFileInfo struct{}

FakeFileInfo for unit test

func (FakeFileInfo) IsDir

func (f FakeFileInfo) IsDir() bool

IsDir for fake method

func (FakeFileInfo) ModTime

func (f FakeFileInfo) ModTime() time.Time

ModTime for fake method

func (FakeFileInfo) Mode

func (f FakeFileInfo) Mode() fs.FileMode

Mode for fake method

func (FakeFileInfo) Name

func (f FakeFileInfo) Name() string

Name for fake method

func (FakeFileInfo) Size

func (f FakeFileInfo) Size() int64

Size for fake method

func (FakeFileInfo) Sys

func (f FakeFileInfo) Sys() interface{}

Sys for fake method

Jump to

Keyboard shortcuts

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