pbutil

package
v2.9.4 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BigIntToDurationpb added in v2.8.0

func BigIntToDurationpb(s sql.NullInt64) *durationpb.Duration

func DurationPbToBigInt added in v2.8.0

func DurationPbToBigInt(duration *durationpb.Duration) sql.NullInt64

func SanitizeTimestampPb added in v2.8.0

func SanitizeTimestampPb(timestamp *timestamppb.Timestamp) sql.NullTime

func TimeToTimestamppb added in v2.8.0

func TimeToTimestamppb(t sql.NullTime) *timestamppb.Timestamp

Types

type ReadWriter

type ReadWriter interface {
	Reader
	Writer
}

ReadWriter is io.ReadWriter for proto.Message instead of []byte.

func NewReadWriter

func NewReadWriter(rw io.ReadWriter) ReadWriter

NewReadWriter returns a new ReadWriter with rw as both its source and its sink.

type Reader

type Reader interface {
	Read(val proto.Message) error
	ReadBytes() ([]byte, error)
}

Reader is io.Reader for proto.Message instead of []byte.

func NewReader

func NewReader(r io.Reader) Reader

NewReader returns a new Reader with r as its source.

type Writer

type Writer interface {
	Write(val proto.Message) (int64, error)
	WriteBytes([]byte) (int64, error)
}

Writer is io.Writer for proto.Message instead of []byte.

func NewWriter

func NewWriter(w io.Writer) Writer

NewWriter returns a new Writer with w as its sink.

Jump to

Keyboard shortcuts

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