Documentation
¶
Index ¶
- Constants
- Variables
- func TagNames(tags []Tag) []string
- type AuxData
- type AuxHeader
- type BooleanFilter
- type Box
- type CID
- type ContentFilter
- type Creator
- type ExportData
- type ExportHeader
- type Field
- type FieldControl
- type FieldControls
- type Filter
- type ImportData
- type ImportHeader
- type ImportStatus
- type InfoData
- type InfoHeader
- type Mode
- type RID
- type Record
- type RecordIntegrity
- type SortFilter
- type SortOrder
- type SyncData
- type SyncHeader
- type SyncStatus
- type TID
- type Tag
- type TagFilter
- type TextFilter
- type TextMatchMode
Constants ¶
const ( ContainerRecords string = "records" FieldRecordID Field = "id" FieldRecordImportTime Field = "import_time" FieldRecordImportIndex Field = "import_index" FieldRecordSource Field = "source" FieldRecordNormalizedURL Field = "normalized_url" FieldRecordDirectURL Field = "direct_url" FieldRecordPlatformID Field = "platform_id" FieldRecordCharacterID Field = "character_id" FieldRecordName Field = "name" FieldRecordTitle Field = "title" FieldRecordCreatorID Field = "creator_id" FieldRecordTagline Field = "tagline" FieldRecordCreateTime Field = "create_time" FieldRecordUpdateTime Field = "update_time" FieldRecordBookUpdateTime Field = "book_update_time" FieldGreetingsCount Field = "greetings_count" FieldRecordHasBook Field = "has_book" FieldRecordIsFork Field = "is_fork" FieldRecordSyncTime Field = "sync_time" FieldRecordSyncStatus Field = "sync_status" FieldRecordExportTime Field = "export_time" FieldRecordExportedVersion Field = "exported_version" FieldRecordFavorite Field = "favorite" )
Record container and field constants
const ( ContainerCreators string = "creators" FieldCreatorID Field = "id" FieldCreatorNickname Field = "nickname" FieldCreatorUsername Field = "username" FieldCreatorPlatformID Field = "platform_id" FieldCreatorSource Field = "source" )
Creator container and field constants
const ( ContainerTags string = "tags" FieldTagID Field = "id" FieldTagName Field = "name" )
Tag container and field constants
Variables ¶
var ContentFields = []Field{ FieldContentDescription, FieldContentPersonality, FieldContentScenario, FieldContentFirstMes, FieldContentMesExample, FieldContentCreatorNotes, FieldContentSystemPrompt, FieldContentPostHistoryInstructions, FieldContentAlternateGreetings, FieldContentDepthPrompt, }
ContentFields is a list of all content field names
Functions ¶
Types ¶
type AuxData ¶
type AuxData struct {
Favorite bool
}
AuxData contains auxiliary flags like favorite status
type BooleanFilter ¶
BooleanFilter represents a boolean filter criterion
type ContentFilter ¶
ContentFilter represents a filter for searching within card content fields
type Creator ¶
type Creator struct {
ID CID `json:"CID"`
Nickname string
Username string
PlatformID string `json:"CreatorPlatformID"`
Source source.ID `json:"CreatorSource"`
}
Creator represents the creator of a character card
type ExportData ¶
ExportData contains export-related metadata
type ExportHeader ¶
type ExportHeader struct {
ID RID
ExportData
}
ExportHeader is a record header with export data
type Field ¶
type Field = string
Field is an alias for string representing a database field name
const ( FieldContentDescription Field = "description" FieldContentPersonality Field = "personality" FieldContentScenario Field = "scenario" FieldContentFirstMes Field = "first_mes" FieldContentMesExample Field = "mes_example" FieldContentCreatorNotes Field = "creator_notes" FieldContentSystemPrompt Field = "system_prompt" FieldContentPostHistoryInstructions Field = "post_history_instructions" FieldContentAlternateGreetings Field = "alternate_greetings" FieldContentDepthPrompt Field = "depth_prompt" )
Content field constants for character card data
type FieldControl ¶
FieldControl represents a filterable field with its display name
type FieldControls ¶
type FieldControls struct {
TextFields []FieldControl
SortableFields []FieldControl
BooleanFields []FieldControl
Sources []source.ID
Statuses []SyncStatus
ContentFields []FieldControl
}
FieldControls defines the available filter controls for the UI
type Filter ¶
type Filter struct {
TextFilter []TextFilter
BooleanFilters []BooleanFilter
SortFilters []SortFilter
Sources []source.ID
Statuses []SyncStatus
ContentFilters []ContentFilter
TagFilter TagFilter
}
Filter contains all active filter criteria for querying records
type ImportData ¶
ImportData contains import-related metadata
type ImportHeader ¶
type ImportHeader struct {
ID RID
ImportData
}
ImportHeader is a record header with import data
type ImportStatus ¶
type ImportStatus string
ImportStatus represents the result of an import operation
const ( ImportFailed ImportStatus = "FAILED" ImportSuccess ImportStatus = "SUCCESS" ImportDuplicate ImportStatus = "DUPLICATE" )
func (ImportStatus) Values ¶
func (ImportStatus) Values() []string
Values returns all possible import status values
type InfoData ¶
type InfoData struct {
Source source.ID
NormalizedURL string
DirectURL string
PlatformID string
CharacterID string
Name string
Title string
Tagline string
CreateTime timestamp.Nano
UpdateTime timestamp.Nano
BookUpdateTime timestamp.Nano
GreetingsCount int
IsFork bool
Tags []Tag
}
InfoData contains the core information about a character card
func (*InfoData) LatestUpdateTime ¶
LatestUpdateTime returns the most recent update timestamp
type InfoHeader ¶
InfoHeader is a record header with info data
type Record ¶
type Record struct {
ID RID
ImportData
InfoData
Creator
SyncData
ExportData
AuxData
}
Record is the main resource record containing all data for a character card
func (*Record) FixIntegrity ¶
func (r *Record) FixIntegrity(sheet *character.Sheet) RecordIntegrity
FixIntegrity attempts to repair inconsistencies between the record and sheet
func (*Record) ToMetadata ¶
ToMetadata converts the record to a metadata model
type RecordIntegrity ¶
type RecordIntegrity byte
RecordIntegrity represents the integrity state of a record
const ( OK RecordIntegrity = iota FIXED BROKEN )
type SortFilter ¶
SortFilter represents a sorting criterion
type SyncData ¶
type SyncData struct {
SyncTime timestamp.Nano
SyncStatus SyncStatus
}
SyncData contains synchronization status and timestamp
type SyncHeader ¶
SyncHeader is a record header with sync data
type SyncStatus ¶
type SyncStatus string
SyncStatus represents the synchronization status of a record
const ( SyncFailed SyncStatus = "FAILED" SyncSuccess SyncStatus = "SUCCESS" SyncUnchanged SyncStatus = "UNCHANGED" SyncMissing SyncStatus = "MISSING" )
func (SyncStatus) Values ¶
func (SyncStatus) Values() []string
Values returns all possible sync status values
type TextFilter ¶
type TextFilter struct {
Field Field
Value string
MatchMode TextMatchMode
}
TextFilter represents a text-based filter criterion
type TextMatchMode ¶
TextMatchMode defines how text matching should be performed