Documentation ¶
Index ¶
- Constants
- func DummyRequest(wd string, qb int) (*http.Request, error)
- func HanChengBihuaRequest(wd string, qb string) (*http.Request, error)
- func HanChengBushouRequest(wd string, qb string) (*http.Request, error)
- func HanChengPinyinRequest(wd string, qb string) (*http.Request, error)
- func InitMysql(addr, name, pass string) *xorm.Engine
- func InitSqlite3(name string) *xorm.Engine
- func KangXiBihuaRequest(wd string, qb string) (*http.Request, error)
- func KangXiBushouRequest(wd string, qb string) (*http.Request, error)
- func KangXiPinyinRequest(wd string, qb string) (*http.Request, error)
- func StartService()
- func StringClearUp(s string) (t string)
- func TrimSlash(s string) string
- func URL(prefix string, uris ...string) string
- type Character
- type CharacterFunc
- type ExArgs
- type Excavator
- type GrabReader
- type ParseFunc
- type Query
- type QueryOptions
- type Radical
- type RadicalCharacter
- type RadicalType
- type RadicalUnion
- type RequestFunc
- type Selenium
Constants ¶
View Source
const ( UnionMustNotBeNull = "union must not be null" UnparsableNumber = "unparsable number" UnionDoesNotContainNumber = "union does not contain number" DecoderShouldNotReturnFloat64 = "decoder should not return float64" UnionDoesNotContainBool = "union does not contain bool" UnionDoesNotContainString = "union does not contain string" UnionDoesNotContainNull = "union does not contain null" UnionDoesNotContainObject = "union does not contain object" UnionDoesNotContainArray = "union does not contain array" CannotHandleDelimiter = "cannot handle delimiter" CannotUnmarshalUnion = "cannot unmarshal union" )
const error list ...
View Source
const DefaultMainPage = "http://hy.httpcn.com"
View Source
const HanChengBihua = "/bihua/zi/"
View Source
const HanChengBushou = "/bushou/zi/"
View Source
const HanChengPinyin = "/pinyin/zi/"
View Source
const KangXiBihua = "/bihua/kangxi/"
View Source
const KangXiBushou = "/bushou/kangxi/"
View Source
const KangXiPinyin = "/pinyin/kangxi/"
Variables ¶
This section is empty.
Functions ¶
func HanChengBihuaRequest ¶ added in v0.1.0
func HanChengBushouRequest ¶ added in v0.1.0
func HanChengPinyinRequest ¶ added in v0.1.0
func KangXiBihuaRequest ¶ added in v0.1.0
func KangXiBushouRequest ¶ added in v0.1.0
func KangXiPinyinRequest ¶ added in v0.1.0
func StartService ¶ added in v0.1.0
func StartService()
Types ¶
type Character ¶
type Character struct { Hash string `xorm:"pk hash"` PinYin []string `xorm:"default() notnull pin_yin"` //拼音 Ch string `xorm:"default() notnull ch"` //字符 Radical string `xorm:"default() notnull radical"` //部首 RadicalStroke int `xorm:"default(0) notnull radical_stroke"` //部首笔画 Stroke int `xorm:"default() notnull stroke"` //总笔画数 IsKangXi bool `xorm:"default(0) notnull is_kang_xi"` //是否康熙字典 KangXi string `xorm:"default() notnull kang_xi"` //康熙 KangXiStroke int `xorm:"default(0) notnull kang_xi_stroke"` //康熙笔画 SimpleRadical string `xorm:"default() notnull simple_radical"` //简体部首 SimpleRadicalStroke int `xorm:"default(0) notnull simple_radical_stroke"` //简体部首笔画 SimpleTotalStroke int `xorm:"default(0) notnull simple_total_stroke"` //简体笔画 TraditionalRadical string `xorm:"default() notnull traditional_radical"` //繁体部首 TraditionalRadicalStroke int `xorm:"default(0) notnull traditional_radical_stroke"` //繁体部首笔画 TraditionalTotalStroke int `xorm:"default(0) notnull traditional_total_stroke"` //简体部首笔画 NameScience bool `xorm:"default(0) notnull name_science"` //姓名学 WuXing string `xorm:"default() notnull wu_xing"` //五行 Lucky string `xorm:"default() notnull lucky"` //吉凶寓意 Regular bool `xorm:"default(0) notnull regular"` //常用 TraditionalCharacter []string `xorm:"default() notnull traditional_character"` //繁体字 VariantCharacter []string `xorm:"default() notnull variant_character"` //异体字 Comment []string `xorm:"default() notnull comment"` //解释 }
Character 字符
func NewCharacter ¶ added in v0.1.0
func NewCharacter() *Character
func (*Character) BeforeInsert ¶ added in v0.1.0
func (c *Character) BeforeInsert()
type ExArgs ¶ added in v0.1.0
type ExArgs func(exc *Excavator)
func ActionArgs ¶ added in v0.1.0
func ActionArgs(act ...RadicalType) ExArgs
type Excavator ¶
type Excavator struct { Workspace string `json:"workspace"` // contains filtered or unexported fields }
Excavator ...
type GrabReader ¶ added in v0.1.0
type GrabReader func(wd string, qb ...string) (reader io.ReadCloser, err error)
type Query ¶ added in v0.1.0
type Query struct {
// contains filtered or unexported fields
}
func NewQuery ¶ added in v0.1.0
func NewQuery(ops ...QueryOptions) *Query
func (*Query) Grab ¶ added in v0.1.0
func (q *Query) Grab(radicalType RadicalType) GrabReader
type QueryOptions ¶ added in v0.1.0
type QueryOptions func(query *Query)
func CacheOption ¶ added in v0.1.0
func CacheOption(cache *net.Cache) QueryOptions
type Radical ¶
type Radical []RadicalUnion
Radical ...
func RadicalReader ¶ added in v0.1.0
func RadicalReader(radicalType RadicalType, wd string, qb string) (*Radical, error)
type RadicalCharacter ¶
type RadicalCharacter struct { Hash string `json:"hash" xorm:"pk hash"` CharType string `json:"char_type" json:"char_type"` Zi string `json:"zi" xorm:"zi"` Alphabet string `json:"alphabet" xorm:"alphabet"` PinYin string `json:"pinyin" xorm:"pinyin"` BiHua string `json:"bihua" xorm:"bihua"` BuShou string `json:"bushou" xorm:"bushou"` TotalBiHua string `json:"total_bihua" xorm:"total_bihua"` QiBi string `json:"qibi" xorm:"qibi"` BHNum string `json:"bh_num" xorm:"bh_num"` QBNum string `json:"qb_num" xorm:"qb_num"` Num string `json:"num" xorm:"num"` URL string `json:"url" xorm:"url"` }
RadicalCharacter ...
func (*RadicalCharacter) BeforeInsert ¶ added in v0.1.0
func (r *RadicalCharacter) BeforeInsert()
func (*RadicalCharacter) GenHash ¶ added in v0.1.0
func (r *RadicalCharacter) GenHash() string
type RadicalType ¶ added in v0.1.0
type RadicalType int
const ( RadicalTypeHanChengPinyin RadicalType = iota RadicalTypeHanChengBushou RadicalTypeHanChengBihua RadicalTypeKangXiPinyin RadicalTypeKangXiBushou RadicalTypeKangXiBihua )
type RadicalUnion ¶
type RadicalUnion struct { String *string RadicalCharacterArray []RadicalCharacter }
RadicalUnion ...
func (*RadicalUnion) MarshalJSON ¶
func (x *RadicalUnion) MarshalJSON() ([]byte, error)
MarshalJSON ...
func (*RadicalUnion) UnmarshalJSON ¶
func (x *RadicalUnion) UnmarshalJSON(data []byte) error
UnmarshalJSON ...
type RequestFunc ¶ added in v0.1.0
type RequestType int
Source Files ¶
Click to show internal directories.
Click to hide internal directories.