size

package
v1.9.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	BytesB  Bytes = 1
	BytesKB       = 1024 * BytesB
	BytesMB       = 1024 * BytesKB
	BytesGB       = 1024 * BytesMB
	BytesTB       = 1024 * BytesGB
	BytesPB       = 1024 * BytesTB
	BytesEB       = 1024 * BytesPB
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bytes

type Bytes int64

Bytes 字节大小

func ParseBytes

func ParseBytes(from string) (bytes Bytes, err error)

ParseBytes 解析字节大小

func (Bytes) Bit

func (b Bytes) Bit() int64

func (Bytes) Byte

func (b Bytes) Byte() int64

func (*Bytes) Formatter

func (b *Bytes) Formatter() *BytesFormatter

func (Bytes) MarshalJSON

func (b Bytes) MarshalJSON() (bytes []byte, err error)

func (Bytes) String

func (b Bytes) String() string

func (*Bytes) UnmarshalJSON

func (b *Bytes) UnmarshalJSON(bytes []byte) (err error)

type BytesFormatter

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

func NewBytesFormatter

func NewBytesFormatter(size *Bytes) *BytesFormatter

func (*BytesFormatter) EB

func (b *BytesFormatter) EB() *BytesFormatter

func (*BytesFormatter) Format

func (b *BytesFormatter) Format() string

func (*BytesFormatter) GB

func (b *BytesFormatter) GB() *BytesFormatter

func (*BytesFormatter) KB

func (b *BytesFormatter) KB() *BytesFormatter

func (*BytesFormatter) MB

func (b *BytesFormatter) MB() *BytesFormatter

func (*BytesFormatter) PB

func (b *BytesFormatter) PB() *BytesFormatter

func (*BytesFormatter) Separator

func (b *BytesFormatter) Separator(separator rune) *BytesFormatter

func (*BytesFormatter) TB

func (b *BytesFormatter) TB() *BytesFormatter

func (*BytesFormatter) Unit

func (b *BytesFormatter) Unit(unit Bytes) *BytesFormatter

Jump to

Keyboard shortcuts

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