size

package
v0.0.0-...-c1b5b8d Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Kilobyte = 1024            // 1 Kilobyte = 1024 bytes
	Megabyte = 1024 * Kilobyte // 1 Megabyte = 1024 Kilobytes
	Gigabyte = 1024 * Megabyte // 1 Gigabyte = 1024 Megabytes
	Terabyte = 1024 * Gigabyte // 1 Terabyte = 1024 Gigabytes
	Petabyte = 1024 * Terabyte // 1 Petabyte = 1024 Terabytes
)

Variables

This section is empty.

Functions

This section is empty.

Types

type S

type S uint64

Represents file sizes:

  • 1 Kilobyte = 1024 bytes
  • 1 Megabyte = 1024 Kilobytes
  • 1 Gigabyte = 1024 Megabytes
  • 1 Terabyte = 1024 Gigabytes
  • 1 Petabyte = 1024 Terabytes

func Parse

func Parse(str string) (S, error)

func (S) String

func (s S) String() string

TODO: Break out size into a units package Size.String()

Jump to

Keyboard shortcuts

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