util

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsElement added in v0.0.13

func ContainsElement[T comparable](list []T, ele T) bool

func DeleteElement added in v0.0.13

func DeleteElement[T comparable](list []T, ele T) []T

func ExistsFile

func ExistsFile(path string) bool

func ReadFile added in v0.0.13

func ReadFile(path string) ([]byte, error)

func RemoveRepeatElement added in v0.0.13

func RemoveRepeatElement[T comparable](list []T) []T

func ServerName added in v0.0.14

func ServerName(data []byte) string

ServerName 256 bit

func WriteBytesFile added in v0.0.13

func WriteBytesFile(path string, dataS ...[]byte) error

func WriteFile

func WriteFile(path string, data []byte) error

Types

type File

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

func GetRootPath

func GetRootPath() ([]*File, error)

func NewFile

func NewFile(path string) (*File, error)

func (*File) Abs

func (f *File) Abs() string

func (*File) Child

func (f *File) Child(path string) (*File, error)

func (*File) Close added in v0.0.11

func (f *File) Close() error

func (*File) Exists

func (f *File) Exists() (flag bool, err error)

func (*File) IsDir

func (f *File) IsDir() bool

func (*File) IsDisk

func (f *File) IsDisk() bool

func (*File) List

func (f *File) List() ([]*File, error)

func (*File) MkDirs

func (f *File) MkDirs() error

func (*File) ModTime

func (f *File) ModTime() (*time.Time, error)

func (*File) Name

func (f *File) Name() string

func (*File) OpenAppendOrCreate

func (f *File) OpenAppendOrCreate() error

func (*File) OpenAppendWrite

func (f *File) OpenAppendWrite() (*bufio.Writer, error)

func (*File) OpenOrCreate

func (f *File) OpenOrCreate() error

func (*File) OpenWrite

func (f *File) OpenWrite() (*bufio.Writer, error)

func (*File) Parent

func (f *File) Parent() string

func (*File) ParentFile

func (f *File) ParentFile() (*File, error)

func (*File) ReadAll

func (f *File) ReadAll() ([]byte, error)

func (*File) ReadBytes

func (f *File) ReadBytes(p []byte) (n int, err error)

func (*File) ToRawFile

func (f *File) ToRawFile() (*os.File, error)

func (*File) Truncate

func (f *File) Truncate() error

func (*File) WriteAppendBytes

func (f *File) WriteAppendBytes(data []byte) error

func (*File) WriteBytes

func (f *File) WriteBytes(data []byte) error

Jump to

Keyboard shortcuts

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