Documentation ¶
Index ¶
- type Broker
- type BrokerConfig
- type Connection
- type Message
- type MessageReader
- func (r *MessageReader[_]) Close() error
- func (r *MessageReader[T]) Read() (*T, error)
- func (r *MessageReader[_]) ReadByte() (byte, error)
- func (r *MessageReader[_]) ReadPayload() ([]byte, error)
- func (r *MessageReader[_]) ReadRaw() ([]byte, error)
- func (r *MessageReader[_]) SetDeadline(t time.Time) error
- func (r *MessageReader[T]) Write(msg *T) error
- func (r *MessageReader[T]) WriteBytes(data *[]byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
* Broker process is to be booted on each node of deployment.
func NewBroker ¶
func NewBroker(opts ...BrokerConfig) *Broker
type BrokerConfig ¶
type BrokerConfig func(b *Broker)
func BrokerPollingTimeout ¶
func BrokerPollingTimeout(timeout time.Duration) BrokerConfig
func BrokerPublishPort ¶
func BrokerPublishPort(port int) BrokerConfig
func BrokerStoreaDir ¶
func BrokerStoreaDir(dir string) BrokerConfig
func BrokerSubscribePort ¶
func BrokerSubscribePort(port int) BrokerConfig
type Connection ¶
type MessageReader ¶
type MessageReader[T any] struct { // contains filtered or unexported fields }
TODO should support copying to writer so we can copy or should just implement Reader but always return correct buckets MessageReader wraps a TCP stream to read/write valid Message.
func NewMessageReader ¶
func NewMessageReader[T any](conn Connection) *MessageReader[T]
func (*MessageReader[_]) Close ¶
func (r *MessageReader[_]) Close() error
func (*MessageReader[T]) Read ¶
func (r *MessageReader[T]) Read() (*T, error)
func (*MessageReader[_]) ReadByte ¶
func (r *MessageReader[_]) ReadByte() (byte, error)
func (*MessageReader[_]) ReadPayload ¶
func (r *MessageReader[_]) ReadPayload() ([]byte, error)
If your message is just bytes, get just payload, no gob involved
func (*MessageReader[_]) ReadRaw ¶
func (r *MessageReader[_]) ReadRaw() ([]byte, error)
func (*MessageReader[_]) SetDeadline ¶
func (r *MessageReader[_]) SetDeadline(t time.Time) error
func (*MessageReader[T]) Write ¶
func (r *MessageReader[T]) Write(msg *T) error
func (*MessageReader[T]) WriteBytes ¶
func (r *MessageReader[T]) WriteBytes(data *[]byte) error
Click to show internal directories.
Click to hide internal directories.