tablestore

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tablestore implements MemoryStore with alibaba cloud tablestore

Index

Constants

View Source
const (
	DefaultSessionTableName          = "session"
	DefaultSessionSecondaryIndexName = "session_secondary_index"
	DefaultSessionSearchIndexName    = "session_search_index"
	DefaultMessageTableName          = "message"
	DefaultMessageSearchIndexName    = "message_search_index"
	DefaultMessageSecondaryIndexName = "message_secondary_index"
)
View Source
const (
	SessionUserIDField        = "user_id"
	SessionSessionIDField     = "session_id"
	SessionUpdateTimeField    = "update_time"
	SessionSearchContentField = "search_content"
)
View Source
const (
	MessageSessionIDField     = "session_id"
	MessageMessageIDField     = "message_id"
	MessageCreateTimeField    = "create_time"
	MessageContentField       = "content"
	MessageSearchContentField = "search_content"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryStore

type MemoryStore struct {
	model.Options
	// contains filtered or unexported fields
}

func NewMemoryStore

func NewMemoryStore(clt *tablestore.TableStoreClient, opts ...model.Option) *MemoryStore

func (*MemoryStore) DeleteAllMessages

func (s *MemoryStore) DeleteAllMessages() (int, error)

func (*MemoryStore) DeleteAllSessions

func (s *MemoryStore) DeleteAllSessions() (int, error)

func (*MemoryStore) DeleteMessage

func (s *MemoryStore) DeleteMessage(sessionID string, messageID string, createTime int64) error

func (*MemoryStore) DeleteMessages

func (s *MemoryStore) DeleteMessages(sessionID string) (int, error)

DeleteMessages delete all messages for a session

func (*MemoryStore) DeleteSession

func (s *MemoryStore) DeleteSession(userID string, sessionID string) error

func (*MemoryStore) DeleteSessionAndMessages

func (s *MemoryStore) DeleteSessionAndMessages(userID, sessionID string) error

DeleteSessionAndMessages delete a session and its messages

func (*MemoryStore) DeleteSessions

func (s *MemoryStore) DeleteSessions(userID string) (int, error)

func (*MemoryStore) GetMessage

func (s *MemoryStore) GetMessage(message *model.Message) error

func (*MemoryStore) GetSession

func (s *MemoryStore) GetSession(session *model.Session) error

func (*MemoryStore) InitMessageTable

func (s *MemoryStore) InitMessageTable() error

func (*MemoryStore) InitSessionTable

func (s *MemoryStore) InitSessionTable() error

func (*MemoryStore) InitTable

func (s *MemoryStore) InitTable() error

func (*MemoryStore) ListAllMessages

func (s *MemoryStore) ListAllMessages() <-chan model.Message

ListAllMessages list all messages

func (*MemoryStore) ListAllSessions

func (s *MemoryStore) ListAllSessions() <-chan model.Session

func (*MemoryStore) ListMessages

func (s *MemoryStore) ListMessages(sessionID string) <-chan model.Message

ListMessages list messages for a session

func (*MemoryStore) ListMessagesPaginated

func (s *MemoryStore) ListMessagesPaginated(
	sessionID string,
	filter tablestore.ColumnFilter,
	inclusiveStartCreateTime int64,
	inclusiveEndCreateTime int64,
	order tablestore.Direction,
	pageSize int,
	nextStartPrimaryKey *tablestore.PrimaryKey,
) (*model.Response[model.Message], error)

ListMessagesPaginated paginated messages

func (*MemoryStore) ListMessagesWithFilter

func (s *MemoryStore) ListMessagesWithFilter(
	sessionID string,
	filter tablestore.ColumnFilter,
	inclusiveStartCreateTime int64,
	inclusiveEndCreateTime int64,
	order tablestore.Direction,
	maxCount int,
	batchSize int,
) <-chan model.Message

ListMessagesWithFilter list messages with filters

func (*MemoryStore) ListRecentSessions

func (s *MemoryStore) ListRecentSessions(userID string, filter tablestore.ColumnFilter, inclusiveStartUpdateTime int64, inclusiveEndUpdateTime int64, maxCount int, batchSize int) ([]model.Session, error)

func (*MemoryStore) ListRecentSessionsPaginated

func (s *MemoryStore) ListRecentSessionsPaginated(userID string, filter tablestore.ColumnFilter, inclusiveStartUpdateTime int64, inclusiveEndUpdateTime int64, pageSize int, nextStartPrimaryKey *tablestore.PrimaryKey) (*model.Response[model.Session], error)

func (*MemoryStore) ListSessions

func (s *MemoryStore) ListSessions(userID string, filter tablestore.ColumnFilter, maxCount int, batchSize int) <-chan model.Session

func (*MemoryStore) PutMessage

func (s *MemoryStore) PutMessage(message *model.Message) error

func (*MemoryStore) PutSession

func (s *MemoryStore) PutSession(session *model.Session) error

func (*MemoryStore) SearchMessages added in v1.0.3

func (s *MemoryStore) SearchMessages(sessionID string, keyword string, inclusiveStartCreateTime int64, inclusiveEndCreateTime int64, pageSize int32, nextToken []byte) (*model.Response[model.Message], error)

func (*MemoryStore) SearchSessions added in v1.0.3

func (s *MemoryStore) SearchSessions(userID string, keyword string, inclusiveStartUpdateTime int64, inclusiveEndUpdateTime int64, pageSize int32, nextToken []byte) (*model.Response[model.Session], error)

func (*MemoryStore) UpdateMessage

func (s *MemoryStore) UpdateMessage(message *model.Message) error

func (*MemoryStore) UpdateSession

func (s *MemoryStore) UpdateSession(session *model.Session) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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