Documentation
¶
Overview ¶
Package model includes models definition
Index ¶
- func CurrentTimeMicroseconds() int64
- type Message
- type MetaType
- type Metadata
- func (m Metadata) Copy() Metadata
- func (m Metadata) Get(key string) (any, bool)
- func (m Metadata) GetBool(key string) *bool
- func (m Metadata) GetBytes(key string) ([]byte, error)
- func (m Metadata) GetFloat64(key string) *float64
- func (m Metadata) GetInt(key string) *int
- func (m Metadata) GetInt64(key string) *int64
- func (m Metadata) GetString(key string) *string
- func (m Metadata) HasKey(key string) bool
- func (m Metadata) Merge(another Metadata) (Metadata, error)
- func (m Metadata) Put(key string, value any) error
- func (m Metadata) PutBool(key string, value bool) error
- func (m Metadata) PutBytes(key string, value []byte) error
- func (m Metadata) PutFloat64(key string, value float64) error
- func (m Metadata) PutInt(key string, value int) error
- func (m Metadata) PutInt64(key string, value int64) error
- func (m Metadata) PutString(key, value string) error
- func (m Metadata) Remove(key string) Metadata
- func (m Metadata) Size() int
- func (m Metadata) ToMap() map[string]any
- type Option
- func WithMessageSearchIndexName(name string) Option
- func WithMessageSecondaryIndexName(name string) Option
- func WithMessageTableName(name string) Option
- func WithSessionSearchIndexName(name string) Option
- func WithSessionSecondaryIndexName(name string) Option
- func WithSessionTableName(name string) Option
- type Options
- type Response
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentTimeMicroseconds ¶
func CurrentTimeMicroseconds() int64
Types ¶
type Message ¶
type Message struct {
SessionID string `json:"session_id,omitempty"`
MessageID string `json:"message,omitempty"`
CreateTime int64 `json:"create_time,omitempty"`
Content string `json:"content,omitempty"`
Metadata Metadata `json:"metadata,omitempty"`
SearchContent string `json:"search_content,omitempty"`
}
func NewMessage ¶
NewMessage creates a message with current time (microseconds)
func NewMessageFull ¶
func NewMessageWithTime ¶
func (*Message) SetContent ¶
func (*Message) SetCreateTime ¶
-------------------- fluent setters (chainable) --------------------
func (*Message) SetMetadata ¶
func (*Message) SetSearchContent ¶ added in v1.0.3
type Metadata ¶
func MetadataFrom ¶
func NewMetadata ¶
func NewMetadata() Metadata
func (Metadata) GetFloat64 ¶
type Option ¶
type Option func(*Options)
func WithMessageSearchIndexName ¶ added in v1.0.3
func WithMessageTableName ¶
func WithSessionSearchIndexName ¶ added in v1.0.3
func WithSessionTableName ¶
type Response ¶
type Response[T any] struct { // Total total amount of search results Total int64 `json:"total,omitempty"` // Hits search results Hits []T `json:"hits,omitempty"` // NextStartPrimaryKey indicates the starting position for the next page. NextStartPrimaryKey *tablestore.PrimaryKey `json:"next_start_primary_key,omitempty"` // NextToken indicates the starting position for the next page (for search) NextToken []byte `json:"next_token,omitempty"` }
type Session ¶
type Session struct {
UserID string `json:"user_id,omitempty"`
SessionID string `json:"session_id,omitempty"`
UpdateTime int64 `json:"update_time,omitempty"`
Metadata Metadata `json:"metadata,omitempty"`
SearchContent string `json:"search_content,omitempty"`
}
func NewSession ¶
NewSession creates a new session with current update time
func NewSessionFull ¶
func NewSessionWithTime ¶
func (*Session) RefreshUpdateTime ¶
func (s *Session) RefreshUpdateTime()
RefreshUpdateTime updates the update time to now (microseconds)
func (*Session) SetMetadata ¶
func (*Session) SetSearchContent ¶ added in v1.0.3
func (*Session) SetUpdateTime ¶
-------------------- fluent setters --------------------
Click to show internal directories.
Click to hide internal directories.