bytes

package
v0.0.5-cap2634.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package bytes helps to represent human-readable size values in JSON.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bytes

type Bytes struct {
	// Value is the number of bytes.
	Value uint64
}

Bytes helps to represent human-readable size values in JSON.

func (Bytes) MarshalJSON

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

MarshalJSON renders bytes as a human-readable JSON string (for example, "20M").

func (*Bytes) UnmarshalJSON

func (b *Bytes) UnmarshalJSON(data []byte) error

UnmarshalJSON parses a JSON string like "512M" into bytes.

Jump to

Keyboard shortcuts

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