Versions in this module Expand all Collapse all v0 v0.0.1 Jan 7, 2021 Changes in this version + var DefaultAckWait = time.Second * 30 + var DefaultSerializer = ProtoSerializer + var ErrIntOverflowMessage = fmt.Errorf("proto: integer overflow") + var ErrInvalidLengthMessage = fmt.Errorf("proto: negative length found during unmarshaling") + var ErrUnexpectedEndOfGroupMessage = fmt.Errorf("proto: unexpected end of group") + type Consumer struct + func NewConsumer(conn stan.Conn, groupID string, options ...ConsumerOption) *Consumer + func (c *Consumer) Close(context.Context) error + func (c *Consumer) Listen(ctx context.Context, channel string, subscription msg.ReceiveMessageFunc) error + type ConsumerOption func(*Consumer) + func WithConsumerActWait(ackWait time.Duration) ConsumerOption + func WithConsumerLogger(logger log.Logger) ConsumerOption + func WithConsumerSerializer(serializer Serializer) ConsumerOption + func WithConsumerSubscriptionOptions(option ...stan.SubscriptionOption) ConsumerOption + type Msg struct + Headers map[string]string + Id string + Payload []byte + func (*Msg) Descriptor() ([]byte, []int) + func (*Msg) ProtoMessage() + func (m *Msg) GetHeaders() map[string]string + func (m *Msg) GetId() string + func (m *Msg) GetPayload() []byte + func (m *Msg) Marshal() (dAtA []byte, err error) + func (m *Msg) MarshalTo(dAtA []byte) (int, error) + func (m *Msg) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *Msg) Reset() + func (m *Msg) Size() (n int) + func (m *Msg) Unmarshal(dAtA []byte) error + func (m *Msg) XXX_DiscardUnknown() + func (m *Msg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *Msg) XXX_Merge(src proto.Message) + func (m *Msg) XXX_Size() int + func (m *Msg) XXX_Unmarshal(b []byte) error + func (this *Msg) Equal(that interface{}) bool + func (this *Msg) GoString() string + func (this *Msg) String() string + type Producer struct + func NewProducer(conn stan.Conn, options ...ProducerOption) *Producer + func (p *Producer) Close(context.Context) error + func (p *Producer) Send(ctx context.Context, channel string, message msg.Message) error + type ProducerOption func(*Producer) + func WithProducerLogger(logger log.Logger) ProducerOption + func WithProducerSerializer(serializer Serializer) ProducerOption + type ProtoSerializer struct + func (ProtoSerializer) Deserialize(message *stan.Msg) (msg.Message, error) + func (ProtoSerializer) Serialize(message msg.Message) ([]byte, error) + type Serializer interface + Deserialize func(message *stan.Msg) (msg.Message, error) + Serialize func(message msg.Message) ([]byte, error)