session

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LineageKindPrimary     = "primary"
	LineageKindCompression = "compression"
	LineageKindFork        = "fork"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MemMap

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

func NewMemMap

func NewMemMap() *MemMap

func (*MemMap) Close

func (*MemMap) Close() error

func (*MemMap) Get

func (m *MemMap) Get(ctx context.Context, key string) (string, error)

func (*MemMap) ListMetadataByUserID

func (m *MemMap) ListMetadataByUserID(ctx context.Context, userID string) ([]Metadata, error)

func (*MemMap) Put

func (m *MemMap) Put(ctx context.Context, key, sessionID string) error

func (*MemMap) PutMetadata

func (m *MemMap) PutMetadata(ctx context.Context, meta Metadata) error

func (*MemMap) ResolveUserID

func (m *MemMap) ResolveUserID(ctx context.Context, source, chatID string) (string, bool, error)

type Metadata

type Metadata struct {
	SessionID       string `json:"session_id"`
	Source          string `json:"source,omitempty"`
	ChatID          string `json:"chat_id,omitempty"`
	UserID          string `json:"user_id,omitempty"`
	Title           string `json:"title,omitempty"`
	ParentSessionID string `json:"parent_session_id,omitempty"`
	LineageKind     string `json:"lineage_kind"`
	CreatedAt       int64  `json:"created_at,omitempty"`
	UpdatedAt       int64  `json:"updated_at"`
}

Jump to

Keyboard shortcuts

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