repository

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyNotExist = redis.Nil
	NoMessage      = cache.ErrNoMessage
)

Functions

This section is empty.

Types

type ProducerRepository

type ProducerRepository interface {
	// Store 暂存消息到本地缓存中
	Store(ctx context.Context, msg domain.Message) error
	// WriteBack 刷新本地缓存到存储介质中
	WriteBack(ctx context.Context, businessName string) error
	// WriteBackLeftTask 如果生产被打断,只把受影响的任务写到黑匣子,由下一任生产者启动时先根据黑匣子生产遗留任务
	WriteBackLeftTask(ctx context.Context, businessName string) error
	GetLeftTask(ctx context.Context) (pushconfig.PushConfig, error)
}

func NewProducerRepository

func NewProducerRepository(local cache.LocalCache, rdb redis.Cmdable) ProducerRepository

type Task

type Task struct {
	BusinessName string
	// map key: deviceType val:id列表
	DeviceMap map[string][]string
}

func NewTask

func NewTask(businessName string) *Task

func (*Task) Add

func (t *Task) Add(msg domain.Message)

func (*Task) Keys

func (t *Task) Keys(biz string) (res []string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL