io

package
v0.0.0-...-4aaf4b1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package io @Link https://gitee.com/linngc/central-mirror @Copyright Copyright (c) 2022 central CLI @Author linngc @License

Package io @Link https://gitee.com/linngc/central-mirror @Copyright Copyright (c) 2022 central CLI @Author linngc @License

Index

Constants

View Source
const (
	KB int64 = 1 << (10 * iota)
	MB
	GB
	TB
)

将KB、MB、GB和TB转换为字节的

View Source
const (
	KBType = "kb"
	MBType = "mb"
	GBType = "gb"
	TBType = "tb"
)

Variables

This section is empty.

Functions

func ByteCountIEC

func ByteCountIEC(b int64) string

ByteCountIEC 以1024作为基数 Byte转成KB、MB、GB、TB

func ByteCountSI

func ByteCountSI(b int64) string

ByteCountSI 以1000作为基数 Byte转成KB、MB、GB、TB

func CloseFile

func CloseFile(f http.File)

CloseFile 关闭文件流

func GetContentType

func GetContentType(fileName string) (extension, contentType string)

GetContentType 根据文件后缀获取文文件类型 @return extension 文件后缀 @return contentType 文件类型

func RespBody

func RespBody(reader io.Reader) ([]byte, string)

func RespReadAll

func RespReadAll(reader io.Reader) []byte

func ToBytes

func ToBytes(size int64, unit Type) int64

ToBytes size是数值,uint是单位 将KB、MB、GB和TB转换为字节的

Types

type Type

type Type string //数据字节单位

Jump to

Keyboard shortcuts

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