textfmt

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package textfmt renders scalar values as the text every streamio output format agrees on: encoding/json's float formatting and ISO-8601 dates and timestamps. It has no dependencies on the record model, so both the record package and the format packages can share it.

Index

Constants

View Source
const (
	Bits32 = 32
	Bits64 = 64
)

Bits32 and Bits64 select the precision AppendFloat formats at.

Variables

This section is empty.

Functions

func AppendDate

func AppendDate(dst []byte, days int64) []byte

AppendDate appends a day count since the Unix epoch to dst as an ISO-8601 calendar date.

func AppendFloat

func AppendFloat(dst []byte, f float64, bitSize int) []byte

AppendFloat formats f exactly as encoding/json's floatEncoder does and appends it to dst.

func AppendTimestampMicros

func AppendTimestampMicros(dst []byte, v int64) []byte

AppendTimestampMicros appends an epoch timestamp in microseconds to dst as an ISO-8601 instant.

func AppendTimestampMillis

func AppendTimestampMillis(dst []byte, v int64) []byte

AppendTimestampMillis appends an epoch timestamp in milliseconds to dst as an ISO-8601 instant.

func AppendTimestampNanos

func AppendTimestampNanos(dst []byte, v int64) []byte

AppendTimestampNanos appends an epoch timestamp in nanoseconds to dst as an ISO-8601 instant.

Types

This section is empty.

Jump to

Keyboard shortcuts

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