metasrc

package
v0.0.0-...-9ed1330 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CC

func CC(r io.Reader, props map[string]*campwiz.Property) error

CC scans CC HTML, emits cross-references

Types

type BingAnswer

type BingAnswer struct {
	Type         string `json:"_type"`
	QueryContext struct {
		OriginalQuery string `json:"originalQuery"`
	} `json:"queryContext"`
	WebPages struct {
		WebSearchURL          string    `json:"webSearchUrl"`
		TotalEstimatedMatches int       `json:"totalEstimatedMatches"`
		Value                 []BingHit `json:"value"`
	} `json:"webPages"`
	RelatedSearches struct {
		ID    string `json:"id"`
		Value []struct {
			Text         string `json:"text"`
			DisplayText  string `json:"displayText"`
			WebSearchURL string `json:"webSearchUrl"`
		} `json:"value"`
	} `json:"relatedSearches"`
	RankingResponse struct {
		Mainline struct {
			Items []struct {
				AnswerType  string `json:"answerType"`
				ResultIndex int    `json:"resultIndex"`
				Value       struct {
					ID string `json:"id"`
				} `json:"value"`
			} `json:"items"`
		} `json:"mainline"`
		Sidebar struct {
			Items []struct {
				AnswerType string `json:"answerType"`
				Value      struct {
					ID string `json:"id"`
				} `json:"value"`
			} `json:"items"`
		} `json:"sidebar"`
	} `json:"rankingResponse"`
}

This struct formats the answers provided by the Bing Web Search API.

func BingSearch

func BingSearch(cs cache.Store, s string) (BingAnswer, error)

type BingHit

type BingHit struct {
	ID               string    `json:"id"`
	Name             string    `json:"name"`
	URL              string    `json:"url"`
	IsFamilyFriendly bool      `json:"isFamilyFriendly"`
	DisplayURL       string    `json:"displayUrl"`
	Snippet          string    `json:"snippet"`
	DateLastCrawled  time.Time `json:"dateLastCrawled"`
	SearchTags       []struct {
		Name    string `json:"name"`
		Content string `json:"content"`
	} `json:"searchTags,omitempty"`
	About []struct {
		Name string `json:"name"`
	} `json:"about,omitempty"`
}

type RosettaEntry

type RosettaEntry struct {
	ID          string `yaml:"id,omitempty"`
	URL         string `yaml:"url,omitempty"`
	ReserveName string `yaml:"reserve_name,omitempty"`
	Locale      string `yaml:"locale,omitempty"`

	Refs map[string]string `yaml:"refs"`
}

func RosettaSearch

func RosettaSearch(e RosettaEntry, cs cache.Store) (RosettaEntry, error)

Jump to

Keyboard shortcuts

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