jsonpb

package
v3.32.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TTNEventStream

func TTNEventStream() runtime.Marshaler

TTNEventStream returns a TTN JsonPb marshaler with double newlines for text/event-stream compatibility.

Types

type TTNDecoder added in v3.16.0

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

TTNDecoder reads JSON data from an io.Reader and unmarshals that into values.

func (*TTNDecoder) Decode added in v3.16.0

func (d *TTNDecoder) Decode(v any) error

Decode reads a value from the reader and unmarshals v from JSON.

type TTNEncoder added in v3.15.1

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

TTNEncoder marshals values to JSON and writes them to an io.Writer.

func (*TTNEncoder) Encode added in v3.15.1

func (e *TTNEncoder) Encode(v any) error

Encode marshals v to JSON and writes it to the writer.

type TTNMarshaler added in v3.15.1

type TTNMarshaler struct {
	*runtime.JSONPb
}

TTNMarshaler is the JSON marshaler/unmarshaler that is used in grpc-gateway.

func TTN

func TTN() *TTNMarshaler

TTN returns the default JSONPb marshaler of The Things Stack.

func (*TTNMarshaler) Marshal added in v3.15.1

func (m *TTNMarshaler) Marshal(v any) ([]byte, error)

Marshal marshals v to JSON.

func (*TTNMarshaler) NewDecoder added in v3.15.1

func (m *TTNMarshaler) NewDecoder(r io.Reader) runtime.Decoder

NewDecoder returns a new JSON decoder that reads data from r.

func (*TTNMarshaler) NewEncoder added in v3.15.1

func (m *TTNMarshaler) NewEncoder(w io.Writer) runtime.Encoder

NewEncoder returns a new JSON encoder that writes values to w.

func (*TTNMarshaler) Unmarshal added in v3.15.1

func (m *TTNMarshaler) Unmarshal(data []byte, v any) error

Unmarshal unmarshals v from JSON data.

Jump to

Keyboard shortcuts

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