Documentation ¶
Index ¶
- Constants
- Variables
- func CheckNetwork() (success bool, information string)
- func Edit(vocabularyEdit VocabularyEditStruct) (success bool, information string)
- func Initialize(path []string) (success bool, information string)
- func Save() (success bool, information string)
- type BingDictionaryStruct
- type CacheItemStruct
- type CacheStruct
- type IcibaCollinsStruct
- type LocationStruct
- type MerriamWebsterStruct
- type ServiceInterface
- type VocabularyAnswerStruct
- type VocabularyAskStruct
- type VocabularyEditStruct
- type VocabularyResultStruct
Constants ¶
const ( // Basic : string for "Status" in "VocabularyAnswerStruct" Basic = "basic" // Advance : string for "Status" in "VocabularyAnswerStruct" Advance = "advance" // Collection : int for "TableType" in "LocationStruct" Collection = 1 // Dictionary : int for "TableType" in "LocationStruct" Dictionary = 2 // Online : int for "TableType" in "LocationStruct" Online = 3 )
Variables ¶
var (
// Setting : mydictionary setting
Setting settingStruct
)
Functions ¶
func CheckNetwork ¶
CheckNetwork : check network
func Edit ¶
func Edit(vocabularyEdit VocabularyEditStruct) (success bool, information string)
Edit : edit
func Initialize ¶
Initialize : initialize the library
Types ¶
type BingDictionaryStruct ¶
type BingDictionaryStruct struct {
// contains filtered or unexported fields
}
BingDictionaryStruct : Bing Dictionary struct
func (*BingDictionaryStruct) GetCache ¶
func (service *BingDictionaryStruct) GetCache() (cache *CacheStruct)
GetCache : get cache
func (*BingDictionaryStruct) GetServiceName ¶
func (service *BingDictionaryStruct) GetServiceName() (value string)
GetServiceName : get service name
func (*BingDictionaryStruct) Query ¶
func (service *BingDictionaryStruct) Query(vocabularyAsk VocabularyAskStruct) (vocabularyAnswer VocabularyAnswerStruct)
Query : query vocabulary
type CacheItemStruct ¶
type CacheItemStruct struct { QueryString string `json:"queryString"` Word string `json:"word"` Definition []string `json:"definition"` Status string `json:"status"` CreationTime int64 `json:"creationTime"` }
CacheItemStruct : item struct
type CacheStruct ¶
type CacheStruct struct { Content []CacheItemStruct `json:"content"` // contains filtered or unexported fields }
CacheStruct : cache struct
func (*CacheStruct) Add ¶
func (cache *CacheStruct) Add(item CacheItemStruct)
Add : add item to cache
func (*CacheStruct) Query ¶
func (cache *CacheStruct) Query(queryString string) (item CacheItemStruct, err error)
Query : query item in cache
func (*CacheStruct) Read ¶
func (cache *CacheStruct) Read(path string, shelfLifeDay int64) (err error)
Read : read cache
func (*CacheStruct) Write ¶
func (cache *CacheStruct) Write() (information string, err error)
Write : write cache
type IcibaCollinsStruct ¶
type IcibaCollinsStruct struct {
// contains filtered or unexported fields
}
IcibaCollinsStruct : iCIBA Collins struct
func (*IcibaCollinsStruct) GetCache ¶
func (service *IcibaCollinsStruct) GetCache() (cache *CacheStruct)
GetCache : get cache
func (*IcibaCollinsStruct) GetServiceName ¶
func (service *IcibaCollinsStruct) GetServiceName() (value string)
GetServiceName : get service name
func (*IcibaCollinsStruct) Query ¶
func (service *IcibaCollinsStruct) Query(vocabularyAsk VocabularyAskStruct) (vocabularyAnswer VocabularyAnswerStruct)
Query : query vocabulary
type LocationStruct ¶
type LocationStruct struct { TableType int `json:"tableType"` TableIndex int `json:"tableIndex"` ItemIndex int `json:"itemIndex"` }
LocationStruct : location of vocabulary
type MerriamWebsterStruct ¶
type MerriamWebsterStruct struct {
// contains filtered or unexported fields
}
MerriamWebsterStruct : Merriam Webster struct
func (*MerriamWebsterStruct) GetCache ¶
func (service *MerriamWebsterStruct) GetCache() (cache *CacheStruct)
GetCache : get cache
func (*MerriamWebsterStruct) GetServiceName ¶
func (service *MerriamWebsterStruct) GetServiceName() (value string)
GetServiceName : get service name
func (*MerriamWebsterStruct) Query ¶
func (service *MerriamWebsterStruct) Query(vocabularyAsk VocabularyAskStruct) (vocabularyAnswer VocabularyAnswerStruct)
Query : query vocabulary
type ServiceInterface ¶
type ServiceInterface interface { GetServiceName() string GetCache() *CacheStruct Query(VocabularyAskStruct) VocabularyAnswerStruct }
ServiceInterface : service interface
type VocabularyAnswerStruct ¶
type VocabularyAnswerStruct struct { Word string `json:"word"` // `xlsx:wd` Definition []string `json:"definition"` // `xlsx:def` SerialNumber int `json:"serialNumber"` // `xlsx:sn` QueryCounter int `json:"queryCounter"` // `xlsx:qc` QueryTime string `json:"queryTime"` // `xlsx:qt` Note []string `json:"note"` // `xlsx:nt` SourceName string `json:"sourceName"` Status string `json:"status"` Location LocationStruct `json:"location"` }
VocabularyAnswerStruct : vocabulary, include word, definition, note and other information
type VocabularyAskStruct ¶
type VocabularyAskStruct struct { Word string `json:"word"` Advance bool `json:"advance"` Online bool `json:"online"` DoNotRecord bool `json:"doNotRecord"` }
VocabularyAskStruct : content and option for query
type VocabularyEditStruct ¶
type VocabularyEditStruct struct { Location LocationStruct `json:"location"` Definition string `json:"definition"` Note string `json:"note"` }
VocabularyEditStruct : editor for definition and note of vocabulary
type VocabularyResultStruct ¶
type VocabularyResultStruct struct { Basic []VocabularyAnswerStruct `json:"basic"` Advance []VocabularyAnswerStruct `json:"advance"` }
VocabularyResultStruct : set of query result
func Query ¶
func Query(vocabularyAsk VocabularyAskStruct) (success bool, vocabularyResult VocabularyResultStruct)
Query : query