Documentation ¶
Index ¶
- type Client
- func (c *Client) GetUserInfo() (*RespUserInfo, error)
- func (c *Client) GetVocabulary(id, typ string) ([]string, error)
- func (c *Client) GetVocabularyList() ([]VocabularyListItem, error)
- func (c *Client) LockupDict(word string) (*DictItem, error)
- func (c *Client) MasteredWords(id string) ([]string, error)
- func (c *Client) Ready() bool
- func (c *Client) SetToken(token string)
- func (c *Client) SubmitVocabulary(words []string) error
- type Config
- type DictItem
- type LockupBody
- type RD
- type RespParseContent2
- type RespUserInfo
- type Response
- type Translation
- type Vocabulary
- type VocabularyBody
- type VocabularyListItem
- type Word
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetUserInfo ¶
func (c *Client) GetUserInfo() (*RespUserInfo, error)
func (*Client) GetVocabulary ¶
GetVocabulary 获取某个生词本的所有单词
func (*Client) GetVocabularyList ¶
func (c *Client) GetVocabularyList() ([]VocabularyListItem, error)
GetVocabularyList 获取生词本列表
func (*Client) MasteredWords ¶
MasteredWords 获取已掌握的单词
func (*Client) SubmitVocabulary ¶
SubmitVocabulary 标记单词已掌握
type DictItem ¶
type DictItem struct { Phonetic []string `json:"phonetic"` Variant []string `json:"variant"` WordFrequency int `json:"wordFrequency"` Definition string `json:"definition"` Id string `json:"_id"` Source string `json:"source"` Lang string `json:"lang"` Translations []Translation `json:"translations"` Display string `json:"display"` Mastered bool `json:"mastered"` Stared bool `json:"stared"` // Sentences []interface{} `json:"sentences"` Revision bool `json:"revision"` NeedRevise bool `json:"needRevise"` }
func (*DictItem) GetMeanings ¶
type LockupBody ¶
type RD ¶
type RD interface { RespUserInfo | RespParseContent2 | Vocabulary | []VocabularyListItem | []DictItem }
type RespParseContent2 ¶
type RespParseContent2 struct {
Words []Word `json:"words"`
}
type RespUserInfo ¶
type Response ¶
type Response[Data RD] struct { Code int `json:"code"` Message interface{} `json:"message"` Data Data `json:"data"` }
func NewResponse ¶
type Translation ¶
type Vocabulary ¶
type VocabularyBody ¶
type VocabularyListItem ¶
type VocabularyListItem struct { Count int `json:"count,omitempty"` Mastered int `json:"mastered,omitempty"` Id string `json:"_id,omitempty"` Uid string `json:"uid,omitempty"` Name string `json:"name"` Id1 string `json:"id"` Type string `json:"type"` CreatedAt time.Time `json:"createdAt,omitempty"` UpdatedAt int64 `json:"updatedAt,omitempty"` Privilege string `json:"privilege,omitempty"` Scope string `json:"scope,omitempty"` Level string `json:"level,omitempty"` Words []string `json:"words,omitempty"` }
type Word ¶
type Word struct { Id string `json:"_id"` Phonetic []string `json:"phonetic"` Variant []string `json:"variant"` WordFrequency int `json:"wordFrequency"` Source string `json:"source"` Display *string `json:"display,omitempty"` Translations []struct { Target string `json:"target"` Pos string `json:"pos"` Score float64 `json:"score"` } `json:"translations"` Lang string `json:"lang"` Mastered bool `json:"mastered"` Stared bool `json:"stared"` Sentences []struct { Id string `json:"_id"` Uid string `json:"uid"` Word string `json:"word"` Sentence string `json:"sentence"` Url string `json:"url"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` Md5 string `json:"md5"` } `json:"sentences"` Revision bool `json:"revision"` NeedRevise bool `json:"needRevise"` Scope string `json:"scope,omitempty"` }
Click to show internal directories.
Click to hide internal directories.