internal

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// B is Byte
	B Unit = 1
	// KB is Kilobyte
	KB = B << 10
	// MB is Megabyte
	MB = KB << 10
	// GB is GigaByte
	GB = MB << 10
	// TB is Terabyte
	TB = GB << 10
	// PB is PetaByte
	PB = TB << 10
	// EB is Extrabyte
	EB = PB << 10
)

Variables

This section is empty.

Functions

func FileIsExist

func FileIsExist(filename string) bool

func GetComments

func GetComments(cg *ast.CommentGroup) []string

func GetKey

func GetKey(pkg string, name string) string

func GetKeyHash

func GetKeyHash(pkg string, name string) string

func IsInternalGenericType added in v0.4.0

func IsInternalGenericType(t string) bool

IsInternalGenericType 是否是内部泛型类型

func IsInternalType

func IsInternalType(t string) bool

IsInternalType 是否是内部类型

func IsPrivate

func IsPrivate(s string) bool

func Md5

func Md5(origin string) string

Types

type Byte added in v0.4.2

type Byte uint64

Byte is defined as uint64, which is equal 8 bit

func (Byte) Convert added in v0.4.2

func (b Byte) Convert(unit Unit) (float64, error)

Convert converts byte to other unit, it will return err if input unit is invalid

func (Byte) ConvertToString added in v0.4.2

func (b Byte) ConvertToString(unit Unit) (string, error)

ConvertToString converts byte to other unit then convert this to string, it will return err if input unit is invalid Result will be corrected to 1 decimal number

func (Byte) ToString added in v0.4.2

func (b Byte) ToString() (string, error)

ToString converts byte to a string which is human-readable

type Unit added in v0.4.2

type Unit uint64

Unit is defined storage unit

Jump to

Keyboard shortcuts

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