db

package
v0.0.0-...-f680af2 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatDb

type ChatDb interface {
	GetMsgList(userId string) ([]Msg, error)
	SetMsgList(userId string, msgList []Msg)
}
var ChatDbInstance ChatDb = nil

func GetChatDb

func GetChatDb() (ChatDb, error)

type Msg

type Msg struct {
	Role string
	Msg  string
}

type RedisChatDb

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

func NewRedisChatDb

func NewRedisChatDb(url string) (*RedisChatDb, error)

func (*RedisChatDb) GetMsgList

func (r *RedisChatDb) GetMsgList(userId string) ([]Msg, error)

func (*RedisChatDb) SetMsgList

func (r *RedisChatDb) SetMsgList(userId string, msgList []Msg)

Jump to

Keyboard shortcuts

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