json

package
v1.9.22 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2025 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WithBytesEncoderFunc = withBytesEncoderFunc

Deprecated: Use WithBytesEncoding instead passing the encoding directly.

Functions

func Encode

func Encode(bytesEncoding string, bytes []byte) string

Encode encodes the given bytes using the specified encoding.

func EncodeBase58

func EncodeBase58(bytes []byte) string

func EncodeBase64

func EncodeBase64(bytes []byte) string

func EncodeHex

func EncodeHex(bytes []byte) string

func Encoder

func Encoder(bytesEncoding string) func([]byte) string

Encoder returns the encoder function that will converts received bytes into a string of the specified encoding.

func ToBase58

func ToBase58(encoder *jsontext.Encoder, t []byte, options json.Options) error

func ToBase64

func ToBase64(encoder *jsontext.Encoder, t []byte, options json.Options) error

func ToHex

func ToHex(encoder *jsontext.Encoder, t []byte, options json.Options) error

Types

type CustomEncoderFunc

type CustomEncoderFunc func(encoder *jsontext.Encoder, t []byte, options json.Options) error

type Marshaller

type Marshaller struct {
	// contains filtered or unexported fields
}

func NewMarshaller

func NewMarshaller(registry *proto.Registry, options ...MarshallerOption) *Marshaller

func (*Marshaller) Marshal

func (m *Marshaller) Marshal(in any) error

func (*Marshaller) MarshalToString

func (m *Marshaller) MarshalToString(in any, jsonEncoderOption ...json.Options) (string, error)

type MarshallerOption

type MarshallerOption func(*Marshaller)

func WithBytesEncoding

func WithBytesEncoding(bytesEncoding string) MarshallerOption

func WithoutUnknownFields

func WithoutUnknownFields() MarshallerOption

Jump to

Keyboard shortcuts

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