opensearch

package
v4.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_IMAGE_HEIGHT int = 16
View Source
const DEFAULT_IMAGE_URI string = "" /* 5617-byte string literal not displayed */
View Source
const DEFAULT_IMAGE_WIDTH int = 16
View Source
const DEFAULT_SEARCHTERMS string = "{searchTerms}"
View Source
const DEFAULT_URL_METHOD string = "GET"
View Source
const DEFAULT_URL_TYPE string = "text/html"
View Source
const NS_MOZILLA_SEARCH string = "http://www.mozilla.org/2006/browser/search/"
View Source
const NS_OPENSEARCH string = "http://a9.com/-/spec/opensearch/1.1/"
View Source
const OPENSEARCH_CONTENT_TYPE string = "application/opensearchdescription+xml"

Variables

This section is empty.

Functions

func AppendOpenSearchPluginsHandler

func AppendOpenSearchPluginsHandler(next http.Handler, plugins map[string]*OpenSearchDescription) http.Handler

func OpenSearchHandler

func OpenSearchHandler(desc *OpenSearchDescription) (http.Handler, error)

Types

type BasicOpenSearchDescriptionOptions

type BasicOpenSearchDescriptionOptions struct {
	Name           string
	Description    string
	QueryParameter string
	SearchTemplate string
	SearchForm     string
	ImageURI       string
}

type OpenSearchDescription

type OpenSearchDescription struct {
	XMLName       xml.Name         `xml:"OpenSearchDescription"`
	NSMoz         string           `xml:"xmlns:moz,attr"`
	InputEncoding string           `xml:"InputEncoding"`
	NSOpenSearch  string           `xml:"xmlns,attr"`
	ShortName     string           `xml:"ShortName"`
	Description   string           `xml:"Description"`
	Image         *OpenSearchImage `xml:"Image"`
	URL           *OpenSearchURL   `xml:"Url"`
	SearchForm    string           `xml:"moz:searchForm"`
}

func (*OpenSearchDescription) Marshal

func (d *OpenSearchDescription) Marshal() ([]byte, error)

type OpenSearchImage

type OpenSearchImage struct {
	Height int    `xml:"height,attr"`
	Width  int    `xml:"width,attr"`
	URI    string `xml:",chardata"`
}

type OpenSearchURL

type OpenSearchURL struct {
	Type       string                    `xml:"type,attr"`
	Method     string                    `xml:"method,attr"`
	Template   string                    `xml:"template,attr"`
	Parameters []*OpenSearchURLParameter `xml:"Param"`
}

type OpenSearchURLParameter

type OpenSearchURLParameter struct {
	Name  string `xml:"name,attr"`
	Value string `xml:"value,attr"`
}

Jump to

Keyboard shortcuts

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