Documentation ¶
Index ¶
- Variables
- func Close()
- func Topics() []*nsqd.Topic
- type Channel
- type ChannelOption
- type Handler
- type Logger
- type Message
- type Topic
- func (p *Topic[M]) DeferredPut(delay time.Duration, v M)
- func (p *Topic[M]) DeleteExistingChannel(name string)
- func (p *Topic[M]) Depth() int64
- func (p *Topic[M]) GetOrCreateChannel(opt *ChannelOption) *Channel[M]
- func (p *Topic[M]) MultiPut(vs []M)
- func (p *Topic[M]) Put(v M)
- func (p *Topic[M]) PutWithTimeout(v M, timeout time.Duration)
- type TopicOption
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultOptions = nsqd.NewOptions()
)
Functions ¶
Types ¶
type Channel ¶
type ChannelOption ¶
type ChannelOption struct { Name string `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty" validate:"required"` // MaxAttempts 为 0 时,表示不限制重试次数 MaxAttempts int64 `json:"max_attempts,omitempty" yaml:"max_attempts,omitempty" toml:"max_attempts,omitempty"` // Expire 为 0 时,表示不过期 Expire time.Duration `json:"expire,omitempty" yaml:"expire,omitempty" toml:"expire,omitempty"` // MaxProcess 为 0 时,则限制为 1 个进程处理 MaxProcess int64 `json:"max_process,omitempty" yaml:"max_process,omitempty" toml:"max_process,omitempty"` }
type Message ¶
type Message struct { CreatedAt int64 `json:"created_at,omitempty" yaml:"created_at,omitempty" toml:"created_at,omitempty"` TraceId string `json:"trace_id,omitempty" yaml:"trace_id,omitempty" toml:"trace_id,omitempty"` // StartAt 为 0 时,表示立即开始 StartAt int64 `json:"start_at,omitempty" yaml:"start_at,omitempty" toml:"start_at,omitempty"` // ExpireAt 为 0 时,表示不过期 ExpireAt int64 `json:"expire_at,omitempty" yaml:"expire_at,omitempty" toml:"expire_at,omitempty"` Attempts uint16 `json:"-" yaml:"-" toml:"-"` MaxAttempts uint16 `json:"max_attempts,omitempty" yaml:"max_attempts,omitempty" toml:"max_attempts,omitempty"` Data []byte `json:"data,omitempty" yaml:"data,omitempty" toml:"data,omitempty"` // contains filtered or unexported fields }
type Topic ¶
type Topic[M any] struct { sync.RWMutex Name string `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty" validate:"required"` // contains filtered or unexported fields }
func (*Topic[M]) DeferredPut ¶
func (*Topic[M]) DeleteExistingChannel ¶
func (*Topic[M]) GetOrCreateChannel ¶
func (p *Topic[M]) GetOrCreateChannel(opt *ChannelOption) *Channel[M]
func (*Topic[M]) PutWithTimeout ¶
type TopicOption ¶
type TopicOption struct {
Name string `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty" validate:"required"`
}
Click to show internal directories.
Click to hide internal directories.