zealindex

package
v0.0.0-...-773dd64 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2019 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareRes

func CompareRes(a, b Result) bool

func ExtractDocs

func ExtractDocs(repoId string, title string, f io.Reader, contentType string, size int64, downloadProgressHandlers ProgressHandlers)

func ExtractFile

func ExtractFile(dbName string, path string, w io.Writer) error

func GetCacheDB

func GetCacheDB() *sql.DB

func ImportRows

func ImportRows(db *sql.DB, all, allMunged, paths *[]string, docsets *[]int, types *[]string, docsetName string, docsetNum int)

func MapType

func MapType(t string) string

func Munge

func Munge(s string) string

func NewSearcher

func NewSearcher(index *GlobalIndex, lastQuery *int) searcher

func SearchAllDocs

func SearchAllDocs(self *searcher, inStr string, allowedDocs map[string]bool, resultCb func(Result), timeCb func(int, time.Duration))

Types

type ContribItem

type ContribItem struct {
	Name    string
	Icon    string
	Icon2x  string `json:"icon@2x"`
	Archive string
}

type DashRepo

type DashRepo struct {
	// contains filtered or unexported fields
}

func NewDashContribRepo

func NewDashContribRepo() DashRepo

func NewDashLocalRepo

func NewDashLocalRepo() DashRepo

func NewDashRepo

func NewDashRepo() DashRepo

func (DashRepo) GetAvailableForInstall

func (d DashRepo) GetAvailableForInstall() ([]RepoItem, error)

func (DashRepo) GetChapters

func (d DashRepo) GetChapters(id, path string) [][]string

func (DashRepo) GetInstalled

func (d DashRepo) GetInstalled() []RepoItem

func (DashRepo) GetPage

func (d DashRepo) GetPage(path string, w io.Writer) error

func (DashRepo) GetSymbols

func (d DashRepo) GetSymbols(index GlobalIndex, id, tp string) [][]string

func (DashRepo) ImportAll

func (d DashRepo) ImportAll(idx GlobalIndex)

func (DashRepo) IndexDocById

func (d DashRepo) IndexDocById(idx GlobalIndex, id string)

func (DashRepo) Name

func (d DashRepo) Name() string

func (DashRepo) RemoveDocset

func (d DashRepo) RemoveDocset(id string, idx GlobalIndex) bool

func (DashRepo) StartDocsetInstallById

func (d DashRepo) StartDocsetInstallById(id string, downloadProgressHandlers ProgressHandlers, completed func()) string

func (DashRepo) StartDocsetInstallByIo

func (d DashRepo) StartDocsetInstallByIo(iostream io.ReadCloser, repoItem RepoItem, len int64, downloadProgressHandlers ProgressHandlers, completed func()) string

type Docbook

type Docbook struct {
	XMLName   xml.Name     `xml:"book"`
	Language  string       `xml:"language,attr"`
	Link      string       `xml:"link,attr"`
	Name      string       `xml:"name,attr"`
	Title     string       `xml:"title,attr"`
	Version   string       `xml:"version,attr"`
	Chapters  []DocbookSub `xml:"chapters>sub"`
	Functions []DocbookKw  `xml:"functions>function"`
	Keywords  []DocbookKw  `xml:"functions>keyword"`
}

func LoadDocBook

func LoadDocBook(f *os.File, gz bool) Docbook

type DocbookKw

type DocbookKw struct {
	Link  string `xml:"link,attr"`
	Name  string `xml:"name,attr"`
	Type  string `xml:"type,attr"`
	Since string `xml:"since,attr"`
}

type DocbookSub

type DocbookSub struct {
	Link string       `xml:"link,attr"`
	Name string       `xml:"name,attr"`
	Subs []DocbookSub `xml:"sub"`
}

type DocbooksRepo

type DocbooksRepo struct {
	// contains filtered or unexported fields
}

func NewDocbooksRepo

func NewDocbooksRepo() DocbooksRepo

func (DocbooksRepo) GetAvailableForInstall

func (d DocbooksRepo) GetAvailableForInstall() ([]RepoItem, error)

func (DocbooksRepo) GetChapters

func (d DocbooksRepo) GetChapters(id, path string) [][]string

func (DocbooksRepo) GetInstalled

func (d DocbooksRepo) GetInstalled() []RepoItem

func (DocbooksRepo) GetPage

func (d DocbooksRepo) GetPage(qPath string, w io.Writer) error

func (DocbooksRepo) GetSymbols

func (d DocbooksRepo) GetSymbols(index GlobalIndex, id, tp string) [][]string

func (DocbooksRepo) ImportAll

func (dr DocbooksRepo) ImportAll(idx GlobalIndex)

func (DocbooksRepo) IndexDocById

func (dr DocbooksRepo) IndexDocById(idx GlobalIndex, id string)

func (DocbooksRepo) Name

func (d DocbooksRepo) Name() string

func (DocbooksRepo) RemoveDocset

func (dr DocbooksRepo) RemoveDocset(id string, idx GlobalIndex) bool

func (DocbooksRepo) StartDocsetInstallById

func (d DocbooksRepo) StartDocsetInstallById(id string, handlers ProgressHandlers, completed func()) string

func (DocbooksRepo) StartDocsetInstallByIo

func (d DocbooksRepo) StartDocsetInstallByIo(iostream io.ReadCloser, repoItem RepoItem, len int64, downloadProgressHandlers ProgressHandlers, completed func()) string

type DocsRepo

type DocsRepo interface {
	Name() string
	ImportAll(idx GlobalIndex)
	GetInstalled() []RepoItem
	GetAvailableForInstall() ([]RepoItem, error)
	StartDocsetInstallById(id string, handlers ProgressHandlers, completed func()) string
	StartDocsetInstallByIo(iostream io.ReadCloser, repoItem RepoItem, len int64, handlers ProgressHandlers, completed func()) string
	GetSymbols(idx GlobalIndex, id, tp string) [][]string
	GetChapters(id, path string) [][]string
	GetPage(path string, w io.Writer) error
	RemoveDocset(id string, idx GlobalIndex) bool
	IndexDocById(idx GlobalIndex, id string)
}

type DocsetIcons

type DocsetIcons struct {
	Icon   string
	Icon2x string
}

type GlobalIndex

type GlobalIndex struct {
	All         *[]string
	AllMunged   *[]string
	Paths       *[]string
	Docsets     *[]int
	Types       *[]string
	DocsetNames *[][]string
	Lock        sync.RWMutex
}

func (*GlobalIndex) UpdateWith

func (i *GlobalIndex) UpdateWith(i2 *GlobalIndex)

type ProgressHandlers

type ProgressHandlers struct {
	Map  map[int]func(string, string, int64, int64)
	Lock sync.RWMutex
}

func NewProgressHandlers

func NewProgressHandlers() ProgressHandlers

type ReaderWithProgress

type ReaderWithProgress struct {
	// contains filtered or unexported fields
}

func NewReaderWithProgress

func NewReaderWithProgress(underlying io.Reader) ReaderWithProgress

func (ReaderWithProgress) Read

func (r ReaderWithProgress) Read(p []byte) (n int, err error)

type RepoItem

type RepoItem struct {
	SourceId       string
	Name           string
	Title          string
	Versions       []string
	Revision       string
	Icon           string
	Icon2x         string
	Language       string
	Extra          RepoItemExtra
	Id             string
	Archive        string
	ContribRepoKey string
	SymbolCounts   map[string]int
}

type RepoItemExtra

type RepoItemExtra struct {
	IndexFilePath string
}

type Result

type Result struct {
	QueryId    int
	Score      int
	Type       string
	Res        string
	Path       string
	RepoName   string
	DocsetName string
	DocsetId   string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL