Documentation
¶
Index ¶
- Constants
- func GetPrimaryTokenIndex(token Token, tokenRangeLength int) int
- func GetTokenAtIndex(length int, index int) Token
- func HashToken(key string) Token
- func Murmur3H1(data []byte) int64
- func PrimaryBroker(partitionKey string, brokersLength int) int
- type BackoffPolicy
- type BrokerStatusInfo
- type Client
- func (c *Client) Close()
- func (c *Client) ManualCommit() ConsumerCommitResult
- func (c *Client) Poll() ConsumerPollResult
- func (c *Client) ProduceJson(topic string, message io.Reader, partitionKey string) error
- func (c *Client) RegisterAsConsumer(options ConsumerOptions)
- func (c *Client) SendStatusRequestToConsumer()
- func (c *Client) Topology() *Topology
- type ClientOptions
- type Topology
Constants ¶
View Source
const DefaultTopologyPollInterval = 10 * time.Second
Variables ¶
This section is empty.
Functions ¶
func GetPrimaryTokenIndex ¶
GetPrimaryTokenIndex returns the broker index of the start token in a given range
func GetTokenAtIndex ¶
func PrimaryBroker ¶
Types ¶
type BackoffPolicy ¶ added in v0.5.0
type BrokerStatusInfo ¶
type BrokerStatusInfo struct {
// contains filtered or unexported fields
}
func NewBrokerStatusInfo ¶
func NewBrokerStatusInfo() *BrokerStatusInfo
func (*BrokerStatusInfo) IsUp ¶
func (b *BrokerStatusInfo) IsUp() bool
func (*BrokerStatusInfo) SetAsDown ¶
func (b *BrokerStatusInfo) SetAsDown()
func (*BrokerStatusInfo) SetAsReconnected ¶
func (b *BrokerStatusInfo) SetAsReconnected()
func (*BrokerStatusInfo) SetAsReconnecting ¶
func (b *BrokerStatusInfo) SetAsReconnecting() bool
func (*BrokerStatusInfo) SetAsUp ¶
func (b *BrokerStatusInfo) SetAsUp()
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ManualCommit ¶
func (c *Client) ManualCommit() ConsumerCommitResult
Performs a manual commit operation on all brokers in the cluster
func (*Client) ProduceJson ¶
func (*Client) RegisterAsConsumer ¶
func (c *Client) RegisterAsConsumer(options ConsumerOptions)
func (*Client) SendStatusRequestToConsumer ¶
func (c *Client) SendStatusRequestToConsumer()
type ClientOptions ¶
type Topology ¶
type Topology struct { BaseName string `json:"baseName,omitempty"` // When defined, it represents the base name to build the broker names, e.g. "polar-" Length int `json:"length"` // The ring size BrokerNames []string `json:"names,omitempty"` ProducerPort int `json:"producerPort"` ProducerBinaryPort int `json:"producerBinaryPort"` ConsumerPort int `json:"consumerPort"` }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.