Documentation ¶
Index ¶
- Variables
- func InitCache()
- type APIDoc
- type APIFenCi
- type APISearch
- func (api *APISearch) GetTermData(theme, word, sortType string, pg int) []*entity.PL
- func (api *APISearch) Search(theme, word, sortType string, pg, count int) ([]*entity.PLTerm, error)
- func (api *APISearch) SearchFull(theme, word, sortType string, pg, count int) ([]*FullList, error)
- func (api *APISearch) SearchId(theme, word, sortType string, pg, count int) ([]string, error)
- func (api *APISearch) SearchList(theme, word, sortType string, pg, count int) ([]*OutList, error)
- type APITheme
- func (api *APITheme) Created(theme *entity.Theme) error
- func (api *APITheme) Get(name string) (*entity.Theme, error)
- func (api *APITheme) GetAll() []*entity.Theme
- func (api *APITheme) GetAllName() []string
- func (api *APITheme) Set2File(theme *entity.Theme) error
- func (api *APITheme) ThemeCacheGet(theme string) (*entity.Theme, error)
- func (api *APITheme) ThemeCacheInit()
- type FullList
- type Lru
- type OutList
- type UrlBody
- type UrlCache
Constants ¶
This section is empty.
Variables ¶
View Source
var DocLru = NewLru(10 * 1000)
DocLru 默认缓存 10w个文档, 如果文档大小 1kb 则是 100000kb
View Source
var ThemeCache map[string]*entity.Theme
View Source
var UrlCacheObj = NewUrlCache()
Functions ¶
Types ¶
type APISearch ¶
type APISearch struct { }
func (*APISearch) GetTermData ¶
func (*APISearch) SearchFull ¶
type APITheme ¶
type APITheme struct { }
func (*APITheme) GetAllName ¶
func (*APITheme) ThemeCacheGet ¶
func (*APITheme) ThemeCacheInit ¶
func (api *APITheme) ThemeCacheInit()
ThemeCacheInit ThemeCache 初始化
type FullList ¶
type FullList struct { Id string `json:"id"` Title string `json:"title"` TimeStamp int64 `json:"timestamp"` Author string `json:"author"` OrderInt int64 `json:"order_int"` Description string `json:"description"` Content string `json:"content"` End int `json:"end"` Start int `json:"start"` Theme string `json:"theme"` SortType string `json:"sort_type"` SortValue float64 `json:"sort_value"` Md5 string `json:"md5"` }
type Lru ¶
type Lru interface { Get(key string) (value *entity.Doc, ok bool) GetKeyFromValue(value *entity.Doc) (key string, ok bool) Put(key string, value *entity.Doc) }
Lru 文档缓存, LRU算法 key theme_docId value doc
type UrlCache ¶
type UrlCache struct {
// contains filtered or unexported fields
}
func NewUrlCache ¶
func NewUrlCache() *UrlCache
Click to show internal directories.
Click to hide internal directories.