Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
URL string
// contains filtered or unexported fields
}
Client is a client for Apache Pulsar Websocket API. Use New to initialize the client with the default configuration.
type Msg ¶
type Msg struct {
// MsgId is a base64-encoded value of the serializable MessageId proto.
MsgId string `json:"messageId"`
// Payload is the message payload.
Payload []byte `json:"payload"`
// PublishTime is the time the message was published.
PublishTime time.Time `json:"publishTime"`
// Properties are an arbitrary set of key-value properties.
Properties map[string]string `json:"properties"`
// Key is the partition key for this message.
Key string `json:"key"`
}
type Producer ¶
type Producer interface {
Send(context.Context, *PublishMsg) (*PublishResult, error)
Close() error
}
type PublishError ¶
type PublishError struct {
Code string `json:"code"`
Msg string `json:"msg"`
Context string `json:"context"`
}
PublishError is the error type used if the server responds with an error.
func (*PublishError) Error ¶
func (e *PublishError) Error() string
Error implements the error interface.
type PublishMsg ¶
type PublishMsg struct {
Payload []byte `json:"payload"`
Properties map[string]string `json:"properties"`
Context string `json:"context"`
Key string `json:"key"`
ReplicationClusters []string `json:"replicationClusters"`
}
PublishMsg is the message type for publishing a new message.
type PublishResult ¶
PublishResult is the result of a successful publish.
Click to show internal directories.
Click to hide internal directories.