service

package
v0.0.0-...-c229084 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventGroupService

type EventGroupService interface {
	// CutGroup 缩减分组中 event 的数量,只保留  keepCount 条(relation_ids 不为空的 events 不能删除)
	CutGroup(ctx context.Context, groupID primitive.ObjectID, keepCount int64) (int64, error)
	// EventShouldRealtime 检查事件是否应该即时发送,如果是,则执行 shouldFn 函数
	// 每次调用该函数,无论是否事件应该即时发送,都会更新时间静默周期,重新计算剩余时间
	EventShouldRealtime(ctx context.Context, evtKey string, silentPeriod time.Duration, shouldFn func())
}

EventGroupService 用于对 eventGroup 操作的 service

func NewEventGroupService

func NewEventGroupService(cc container.Container) EventGroupService

NewEventGroupService create a new event group service

type EventService

type EventService interface {
	// Add add a new event to repository
	Add(ctx context.Context, msg extension.CommonEvent) (primitive.ObjectID, error)
}

func NewEventService

func NewEventService(cc container.Container) EventService

type ServiceProvider

type ServiceProvider struct{}

func (ServiceProvider) Boot

func (p ServiceProvider) Boot(app infra.Glacier)

func (ServiceProvider) Register

func (p ServiceProvider) Register(app container.Container)

Jump to

Keyboard shortcuts

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