encoding

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeGOB

func DecodeGOB(data []byte, result any) error

DecodeGOB decodes a GOB byte slice into the provided result pointer.

func DecodeJSON

func DecodeJSON(value string, result any) error

DecodeJSON decodes a JSON string into the provided result pointer.

func DecodeXML

func DecodeXML(value string, result any) error

DecodeXML decodes an XML string into the provided result pointer.

func FromBase64

func FromBase64(s string) ([]byte, error)

FromBase64 decodes a base64 string to binary data using standard encoding.

func FromBase64URL

func FromBase64URL(s string) ([]byte, error)

FromBase64URL decodes a base64 URL-safe string to binary data.

func FromGOB

func FromGOB[T any](data []byte) (*T, error)

FromGOB converts a GOB byte slice to a struct value.

func FromHex

func FromHex(s string) ([]byte, error)

FromHex decodes a hexadecimal string to binary data.

func FromJSON

func FromJSON[T any](value string) (*T, error)

FromJSON converts a JSON string to a struct value.

func FromXML

func FromXML[T any](value string) (*T, error)

FromXML converts an XML string to a struct value.

func ToBase64

func ToBase64(data []byte) string

ToBase64 encodes binary data to a base64 string using standard encoding.

func ToBase64URL

func ToBase64URL(data []byte) string

ToBase64URL encodes binary data to a base64 URL-safe string.

func ToGOB

func ToGOB(value any) ([]byte, error)

ToGOB converts a struct value to a GOB byte slice.

func ToHex

func ToHex(data []byte) string

ToHex encodes binary data to a hexadecimal string.

func ToJSON

func ToJSON(value any) (string, error)

ToJSON converts a struct value to a JSON string.

func ToXML

func ToXML(value any) (string, error)

ToXML converts a struct value to an XML string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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