Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Extra ¶
type Extra struct { ID string `gorm:"primarykey" json:"id"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` Chinese string `gorm:"index:,unique;not null" json:"chinese"` Pinyin string `json:"pinyin"` English string `gorm:"-" json:"english"` Type string `gorm:"-" json:"type"` Description string `json:"description"` Tag string `gorm:"-" json:"tag"` }
Extra is user database model for Extra
type Library ¶
type Library struct { ID string `gorm:"primarykey" json:"id"` CreatedAt time.Time UpdatedAt time.Time Title string `gorm:"index:idx_library_user_title,unique;not null" json:"title"` Entries StringArray `json:"entries"` Description string `json:"description"` Tag string `gorm:"-" json:"tag"` }
Library is user database model for Library
type Quiz ¶
type Quiz struct { ID string `gorm:"primaryKey" json:"id"` CreatedAt time.Time UpdatedAt time.Time // Entry references Entry string `gorm:"index:quiz_unique_idx,unique;not null" json:"entry"` Type string `gorm:"index:quiz_unique_idx,unique;not null;check:[type] in ('hanzi','vocab','sentence')" json:"type"` Direction string `gorm:"index:quiz_unique_idx,unique;not null;check:direction in ('se','ec','te')" json:"direction"` Source string `gorm:"index;not null" json:"source"` Description string `gorm:"-"` Tag string `gorm:"-"` // Quiz statistics SRSLevel *int8 `gorm:"index"` NextReview *time.Time `gorm:"index"` LastRight *time.Time `gorm:"index" json:"lastRight"` LastWrong *time.Time `gorm:"index"` RightStreak *uint `gorm:"index"` WrongStreak *uint `gorm:"index" json:"wrongStreak"` MaxRight *uint `gorm:"index"` MaxWrong *uint `gorm:"index"` }
Quiz is the database model for quiz
func (*Quiz) UpdateSRSLevel ¶
UpdateSRSLevel updates SRSLevel and also updates stats
type Sentence ¶
Sentence caches sentences from http://www.jukuu.com/search.php?q=%s
type StringArray ¶
type StringArray []string
StringArray type that is compat with both SQLite and PostGres
func (*StringArray) Scan ¶
func (sa *StringArray) Scan(value interface{}) error
Scan (internal) to-external method for StringArray Type
type User ¶
type User struct { ID string `gorm:"primaryKey"` CreatedAt time.Time UpdatedAt time.Time Meta UserMeta }
User holds user data
type UserMeta ¶
type UserMeta struct { Forvo *string `json:"forvo"` Level *uint `json:"level"` LevelMin *uint `json:"levelMin"` Settings struct { Level struct { WhatToShow string `json:"whatToShow"` } `json:"level"` Quiz struct { Type []string `json:"type"` Stage []string `json:"stage"` Direction []string `json:"direction"` IncludeUndue bool `json:"includeUndue"` IncludeExtra bool `json:"includeExtra"` Q string `json:"q"` } `json:"quiz"` Sentence struct { Min *uint `json:"min"` Max *uint `json:"max"` } `json:"sentence"` } `json:"settings"` }
UserMeta holds User's settings
func (UserMeta) GormDBDataType ¶
GormDBDataType represents UserMeta's data type
Source Files ¶
Click to show internal directories.
Click to hide internal directories.