Documentation
¶
Index ¶
- Variables
- type Options
- func (o *Options) GetDB() int
- func (o *Options) GetQueueName() string
- func (o *Options) GetRedisAddr() string
- func (o *Options) GetTimeout() time.Duration
- func (o *Options) SetDB(db int) *Options
- func (o *Options) SetQueueName(name string) *Options
- func (o *Options) SetRedisAddr(addr string) *Options
- func (o *Options) SetRedisPassword(password string) *Options
- func (o *Options) SetTimeout(timeout time.Duration) *Options
- func (o *Options) Validate() error
- type Payload
- type PrimitivePayload
- type Queue
- type Queuer
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidQueueName = errors.New("invalid queue name")
ErrInvalidQueueName is returned when the queue name is invalid.
View Source
var ErrInvalidRedisAddr = errors.New("invalid Redis address")
ErrInvalidRedisAddr is returned when the Redis address is invalid.
View Source
var ErrInvalidTimeout = errors.New("invalid timeout")
ErrInvalidTimeout is returned when the timeout is invalid.
View Source
var (
ErrTimeout = errors.New("no message received within the timeout")
)
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { RedisAddr string RedisPassword string DB int QueueName string Timeout time.Duration }
func NewDefaultOptions ¶
func NewDefaultOptions() *Options
func (*Options) GetQueueName ¶
func (*Options) GetRedisAddr ¶
func (*Options) GetTimeout ¶
func (*Options) SetQueueName ¶
func (*Options) SetRedisAddr ¶
func (*Options) SetRedisPassword ¶
type PrimitivePayload ¶
type PrimitivePayload[T any] struct { Value *T }
PrimitivePayload wraps a primitive type or struct to make it a Payload.
func NewPayloadFromPtr ¶
func NewPayloadFromPtr[T any](value *T) *PrimitivePayload[T]
NewPayloadFromPtr wraps an existing pointer in a PrimitivePayload.
func NewPayloadFromValue ¶
func NewPayloadFromValue[T any](value T) *PrimitivePayload[T]
NewPayloadFromValue creates a new PrimitivePayload with a value. The value will be wrapped in a pointer.
func (*PrimitivePayload[T]) Marshal ¶
func (p *PrimitivePayload[T]) Marshal() ([]byte, error)
func (*PrimitivePayload[T]) Unmarshal ¶
func (p *PrimitivePayload[T]) Unmarshal(data []byte) error
Click to show internal directories.
Click to hide internal directories.