seenstate

package
v0.0.0-...-6de2a4b Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: GPL-3.0, GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package seenstate holds implementations of the SeenState that the client session uses to keep track of what messages it has seen.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SeenState

type SeenState interface {
	// Set() (re)sets the given level to the given value.
	SetLevel(level string, top int64) error
	// GetAll() returns a "simple" map of the current levels.
	GetAllLevels() (map[string]int64, error)
	// FilterBySeen filters notifications already seen, keep track
	// of them as well.
	FilterBySeen([]protocol.Notification) ([]protocol.Notification, error)
	// Close closes state.
	Close()
}

func NewSeenState

func NewSeenState() (SeenState, error)

NewSeenState returns an implementation of SeenState that is memory-based and does not save state.

func NewSqliteSeenState

func NewSqliteSeenState(filename string) (SeenState, error)

NewSqliteSeenState returns an implementation of SeenState that keeps and persists the state in an sqlite database.

Jump to

Keyboard shortcuts

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