types

package
v3.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package types provides custom JSON types for Gripmock.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteSize added in v3.5.0

type ByteSize struct {
	Bytes int64
}

ByteSize is an env-decodable size with K|M|G suffix support (decimal kilobytes/mebibytes/gibibytes). Examples: "128K", "64M", "1G", or plain integer bytes like "262144".

func (*ByteSize) Int64 added in v3.5.0

func (b *ByteSize) Int64() int64

Int64 returns the value in bytes.

func (*ByteSize) UnmarshalText added in v3.5.0

func (b *ByteSize) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler for ByteSize.

type Duration

type Duration time.Duration

Duration is a custom type alias for time.Duration that provides JSON marshaling/unmarshaling support for string values like "100ms".

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface.

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

Jump to

Keyboard shortcuts

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