database

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GormMemoryBackend

type GormMemoryBackend struct {
	// contains filtered or unexported fields
}

GormMemoryBackend implements core.MemoryBackend Uses GORM connection to retrieve memory from Postgres database

func NewGormMemoryBackend

func NewGormMemoryBackend(db *gorm.DB, userID string) *GormMemoryBackend

NewGormMemoryBackend returns a new GormMemoryBackend

func (*GormMemoryBackend) Add

func (a *GormMemoryBackend) Add(m ...*core.Message) error

Add adds messages to the GormMemoryBackend using "append"

func (*GormMemoryBackend) Dump

func (a *GormMemoryBackend) Dump() ([]*core.Message, error)

Dump returns the whole GormMemoryBackend array

func (*GormMemoryBackend) GetMaxN

func (a *GormMemoryBackend) GetMaxN(n int) ([]*core.Message, error)

GetMaxN returns the last N number of messages

func (*GormMemoryBackend) Migrate

func (a *GormMemoryBackend) Migrate() error

Migrate database add the infraestruct tables and relations

func (*GormMemoryBackend) Prune

func (a *GormMemoryBackend) Prune()

Prune resets the array in the GormMemoryBackend

Jump to

Keyboard shortcuts

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