notification_service

package
v0.0.0-...-ba64992 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EventsBsonToJson

func EventsBsonToJson(input []bsoncore.Document) ([]json.RawMessage, error)

func NotificationDocToJson

func NotificationDocToJson(document *NotificationDocument) ([]byte, error)

func NotificationTopicName

func NotificationTopicName(accountId string) string

Types

type NotificationDocument

type NotificationDocument struct {
	Id        primitive.ObjectID `bson:"_id,omitempty"`
	TenantId  string             `bson:"tenantId"`
	AccountId string             `bson:"accountId"`
	Subject   string             `bson:"subject"`
	Step      internal_bson.Step `bson:"step"`

	ReadMarked bool `bson:"readMarked"`
	Deleted    bool `bson:"deleted"`
}

func (*NotificationDocument) GetId

func (d *NotificationDocument) GetId() string

func (*NotificationDocument) ToUpdate

func (d *NotificationDocument) ToUpdate(newId primitive.ObjectID) (bson.M, error)

type NotificationFilter

type NotificationFilter struct {
	ContinueToken string // 마지막 가져온 _id
	Limits        int
}

type NotificationService

type NotificationService interface {
	Start(appCtx context.Context, mongoDatabase *mongo.Database) error
	CreateNotification(document *NotificationDocument) error
	GetNotifications(tenantId string, accountId string, filter *NotificationFilter) ([]*NotificationDocument, error)
	MarkNotifications(tenantId string, accountId string, params *api_proto.MarkNotificationsRequest) error
}

func New

Jump to

Keyboard shortcuts

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