utils

package
v0.0.2-beta.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeserializeProto

func DeserializeProto(bys []byte, msg proto.Message) error

DeserializeProto deserializes proto message from bytes.

func PAppStatusErrorCode

func PAppStatusErrorCode(input ybApi.AppStatusPB_ErrorCode) *ybApi.AppStatusPB_ErrorCode

PAppStatusErrorCode returns a pointer to the given input AppStatusErrorCode.

func PBool

func PBool(a bool) *bool

PBool returns a pointer to an bool.

func PCDCErrorCode

func PCDCErrorCode(input ybApi.CDCErrorPB_Code) *ybApi.CDCErrorPB_Code

PCDCErrorCode returns a pointer to the given input CDCErrorCode.

func PConsensusErrorCode

func PConsensusErrorCode(input ybApi.ConsensusErrorPB_Code) *ybApi.ConsensusErrorPB_Code

PConsensusErrorCode returns a pointer to the given input ConsensusErrorCode.

func PInt32

func PInt32(a int32) *int32

PInt32 returns a pointer to an int32.

func PMasterErrorCode

func PMasterErrorCode(input ybApi.MasterErrorPB_Code) *ybApi.MasterErrorPB_Code

PMasterErrorCode returns a pointer to the given input MasterErrorCode.

func PRemoteBootstrapErrorCode

func PRemoteBootstrapErrorCode(input ybApi.RemoteBootstrapErrorPB_Code) *ybApi.RemoteBootstrapErrorPB_Code

PRemoteBootstrapErrorCode returns a pointer to the given input RemoteBootstrapErrorCode.

func PString

func PString(a string) *string

PString returns a pointer to a string.

func PTableServerErrorCode

func PTableServerErrorCode(input ybApi.TabletServerErrorPB_Code) *ybApi.TabletServerErrorPB_Code

PTableServerErrorCode returns a pointer to the given input TableServerErrorCode.

func PUint32

func PUint32(a uint32) *uint32

PUint32 returns a pointer to an uint32.

func PUint64

func PUint64(a uint64) *uint64

PUint64 returns a pointer to an uint64.

func PYQLDatabase

func PYQLDatabase(input ybApi.YQLDatabase) *ybApi.YQLDatabase

PYQLDatabase returns a pointer to the given input YQLDatabase.

func ReadInt

func ReadInt(reader io.Reader) (int, error)

ReadInt reads an int from a reader.

func ReadUvarint32

func ReadUvarint32(r io.ByteReader) (uint64, error)

ReadUvarint32 reads an encoded unsigned 32-bit integer from r and returns it as a uint64.

func ReadVarint32

func ReadVarint32(r io.ByteReader) (int64, error)

ReadVarint32 reads an encoded signed integer from r and returns it as an int64.

func SerializeProto

func SerializeProto(msg proto.Message) ([]byte, error)

SerializeProto serializes proto message to bytes.

func WriteMessages

func WriteMessages(b io.Writer, msgs ...protoreflect.ProtoMessage) error

WriteMessages writes a variable number of protobuf messages into a given writer. This code is essentially based on: https://github.com/yugabyte/yugabyte-db/blob/v2.7.2/java/yb-client/src/main/java/org/yb/client/YRpc.java#L274 In the Java code, the Message header is the requestHeader, the Message pb is the actual payload.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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