encoding

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package encoding contains all elements to encode to basic formats like JSON and text.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffered

type Buffered interface {
	Bytes() []byte
	String() string
}

type BufferedJsonEncoder

type BufferedJsonEncoder interface {
	JsonEncoder
	Buffered
}

func NewBufferedJsonEncoder

func NewBufferedJsonEncoder() BufferedJsonEncoder

type BufferedTextEncoder

type BufferedTextEncoder interface {
	TextEncoder
	Buffered
}

func NewBufferedTextEncoder

func NewBufferedTextEncoder() BufferedTextEncoder

type JsonEncoder

type JsonEncoder interface {
	TextEncoder

	WriteKeyValue(k string, v interface{}) error
	WriteKeyValueChecked(k string, v interface{}) func() error

	WriteValue(v interface{}) error
	WriteValueChecked(v interface{}) func() error
}

JsonEncoder encodes given elements to JSON format.

type TextEncoder

type TextEncoder interface {
	io.ByteWriter
	WriteByteChecked(byte) func() error

	WriteBytes([]byte) error
	WriteBytesChecked([]byte) func() error

	WriteString(string) error
	WriteStringChecked(string) func() error
	WriteStringPChecked(*string) func() error
}

TextEncoder encodes given elements to text format.

Jump to

Keyboard shortcuts

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