utils

package
v0.0.0-...-941bdb3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProtoVersion is the Pulsar protocol version
	// used by this client.
	ProtoVersion = int32(api.ProtocolVersion_v12)

	// ClientVersion is an opaque string sent
	// by the client to the server on connect, eg:
	// "Pulsar-Client-Java-v1.15.2"
	ClientVersion = "pulsar-client-go"

	// NndefRequestID defines a RequestID of -1.
	//
	// Usage example:
	// https://github.com/apache/incubator-pulsar/blob/fdc7b8426d8253c9437777ae51a4639239550f00/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java#L325
	UndefRequestID = 1<<64 - 1
)
View Source
const AuthMethodTLS = "tls"

authMethodTLS is the name of the TLS authentication method, used in the CONNECT message.

Variables

This section is empty.

Functions

func PulsarAddr

func PulsarAddr(t *testing.T) string

PulsarAddr is a helper function that either returns the non-blank pulsar address, or skips the test.

func RandString

func RandString(n int) string

Types

type AsyncErrors

type AsyncErrors chan<- error

AsyncErrors provides idiom for sending in a non-blocking manner errors to a channel. Note: it's legal for asyncErrors to be nil

func (AsyncErrors) Send

func (a AsyncErrors) Send(err error)

Send places the error on the channel in a non-blocking way

type UnexpectedErrMsg

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

UnexpectedErrMsg is returned when an unexpected message is received.

func NewUnexpectedErrMsg

func NewUnexpectedErrMsg(msgType api.BaseCommand_Type, ids ...interface{}) *UnexpectedErrMsg

NewUnexpectedErrMsg instantiates an ErrUnexpectedMsg error. Optionally provide a list of IDs associated with the message for additional context in the error message.

func (*UnexpectedErrMsg) Error

func (e *UnexpectedErrMsg) Error() string

Error satisfies the error interface.

Jump to

Keyboard shortcuts

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