Documentation ¶
Index ¶
Constants ¶
View Source
const TableNamePhrase = "phrase"
View Source
const TableNameWord = "word"
View Source
const TableNameWordPhrase = "word_phrase"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Phrase ¶
type Phrase struct { PhraseID string `gorm:"column:phrase_id;type:TEXT" json:"phrase_id"` Phrase string `gorm:"column:phrase;type:TEXT" json:"phrase"` CreateTime int64 `gorm:"column:create_time;type:BIGINT" json:"create_time"` UpdateTime int64 `gorm:"column:update_time;type:BIGINT" json:"update_time"` }
Phrase mapped from table <phrase>
type Word ¶
type Word struct { WordID string `gorm:"column:word_id;primaryKey" json:"word_id"` Word string `gorm:"column:word;not null" json:"word"` Phonetic string `gorm:"column:phonetic;not null" json:"phonetic"` Definition string `gorm:"column:definition;not null" json:"definition"` Difficulty string `gorm:"column:difficulty;not null" json:"difficulty"` LastUsed int64 `gorm:"column:last_used;not null" json:"last_used"` NumRepetitions int32 `gorm:"column:num_repetitions;not null" json:"num_repetitions"` CreateTime int64 `gorm:"column:create_time;not null" json:"create_time"` UpdateTime int64 `gorm:"column:update_time;not null" json:"update_time"` }
Word mapped from table <word>
func (*Word) SetDefinition ¶
func (*Word) SetPhonetic ¶
type WordPhrase ¶
type WordPhrase struct { WordPhraseID string `gorm:"column:word_phrase_id;type:TEXT" json:"word_phrase_id"` WordID string `gorm:"column:word_id;type:TEXT" json:"word_id"` PhraseID string `gorm:"column:phrase_id;type:TEXT" json:"phrase_id"` CreateTime int64 `gorm:"column:create_time;type:BIGINT" json:"create_time"` UpdateTime int64 `gorm:"column:update_time;type:BIGINT" json:"update_time"` }
WordPhrase mapped from table <word_phrase>
func NewWordPhrase ¶
func NewWordPhrase(wordId, phraseId string) *WordPhrase
func (*WordPhrase) TableName ¶
func (*WordPhrase) TableName() string
TableName WordPhrase's table name
type Words ¶
type Words []*Word
func (Words) GenerateWordPhrase ¶
func (words Words) GenerateWordPhrase(phraseId string) (list []*WordPhrase)
func (Words) ListByLetter ¶
func (Words) RandomPick ¶
Click to show internal directories.
Click to hide internal directories.