quake

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QUAKE      = "QUAKE"
	AUTH_URL   = "https://quake.360.cn/api/v3/user/info"
	SEARCH_URL = "https://quake.360.cn/api/v3/search/quake_service"
)

Variables

This section is empty.

Functions

func ToQuakeGrammar

func ToQuakeGrammar(s string) (string, error)

Types

type Provider

type Provider struct {
}

func (*Provider) Auth

func (p *Provider) Auth(s *sources.Session) bool

Auth checks if the provider is valid to use

func (*Provider) Name

func (p *Provider) Name() string

Name returns the name of the provider

func (*Provider) Search

func (p *Provider) Search(query *sources.Query) (chan *sources.Result, error)

Search the result with provider

type QuakeSearchFiled

type QuakeSearchFiled struct {
	Query       string      `json:"query"` // Query sentence
	Start       int         `json:"start"` // Paging Index
	Size        int         `json:"size"`  // Paging Size
	IgnoreCache interface{} `json:"ignore_cache"`
	StartTime   string      `json:"start_time"` // Query start time
	EndTime     string      `json:"end_time"`   // Inquiry off time
}

QuakeSearchFiled quake query interface parameters

func NewQuakeSearchFiled

func NewQuakeSearchFiled(query string, pageIndex, pageSize int) *QuakeSearchFiled

NewQuakeSearchFiled construct of QuakeSearchFiled struct

type QuakeSearchResult

type QuakeSearchResult struct {
	Code    interface{} `json:"code,omitempty"`
	Message string      `json:"message,omitempty"`
	Data    []struct {
		Service struct {
			Http struct {
				Host            string                 `json:"host"`
				Title           string                 `json:"title"`
				MetaKeywords    string                 `json:"meta_keywords"`
				XPoweredBy      string                 `json:"x_powered_by"`
				HttpLoadUrl     []string               `json:"http_load_url"`
				Robots          string                 `json:"robots"`
				SitemapHash     string                 `json:"sitemap_hash"`
				Server          string                 `json:"server"`
				Body            string                 `json:"body"`
				RobotsHash      string                 `json:"robots_hash"`
				Sitemap         string                 `json:"sitemap"`
				Path            string                 `json:"path"`
				SecurityText    string                 `json:"security_text"`
				StatusCode      int                    `json:"status_code"`
				ResponseHeaders string                 `json:"response_headers"`
				Icp             map[string]interface{} `json:"icp"` // Todo more effective way to get icp info
			} `json:"http,omitempty"`
		} `json:"service,omitempty"`
		Port     int    `json:"port"`
		Asn      int    `json:"asn"`
		IP       string `json:"ip"`
		Hostname string `json:"hostname"`
		Domain   string `json:"domain"`
	} `json:"data,omitempty"`
	Meta struct {
		Pagination struct {
			Count     int `json:"count"`
			PageIndex int `json:"page_index"`
			PageSize  int `json:"page_size"`
			Total     int `json:"total"`
		} `json:"pagination"`
	} `json:"meta,omitempty"`
}

QuakeSearchResult Quake service data interface return data structure

func NewQuakeSearchResult

func NewQuakeSearchResult() *QuakeSearchResult

NewQuakeSearchResult construct of QuakeSearchResult struct

Jump to

Keyboard shortcuts

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