msgstore

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package msgstore provides functionality for storing and retrieving messages (events) to/from a database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogResponse

func LogResponse(ctx *b.Context, spec m.Map, msg *b.Message)

func ReplayMessages

func ReplayMessages(ctx *b.Context, spec m.Map, msg *b.Message)

Types

type RC

type RC byte
const (
	RC_identical RC = iota
	RC_no_change
	RC_changed
	RC_new
	RC_error
)

func LogMessage

func LogMessage(ctx *b.Context, msg *b.Message,
	timestamp *b.Timestamp, recordIdentical bool) (RC, m.Changes)

LogMessage records a message in the database. It first checks if a message with the same key as the supplied (new) one is already present in the database. If this is not the case the new message is stored and the info `RC_new` is returned. Otherwise the payload of the new message is compared to the present one's payload; if they are different, a record with the new message is inserted and the info `RC_changed` is returned, together with a mapping of the existing fields that have changed. If there is an already identical message in the database, the info `RC_no_change` is returned; if the parameter `recordIdentical` is set to true an addition record with the message (with updated timestamp) is inserted.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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