searchch

package
v0.0.0-...-1994f34 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultURL the default api service url
	DefaultURL = "https://tel.search.ch/api/"
	// TestURL the test api service url
	TestURL = "https://tel.search.ch/examples/api-response.xml"
)

Variables

This section is empty.

Functions

func New

func New(key string) search.Client

New create a new client with the given key

func NewFor

func NewFor(config search.Config) search.Client

NewFor create a new client for the given config

Types

type Author

type Author struct {
	Name string `xml:"name"`
}

Author author element

type Entry

type Entry struct {
	ID         string    `xml:"id"`
	Updated    time.Time `xml:"updated"`
	Published  time.Time `xml:"published"`
	Title      Type      `xml:"title"`
	Content    Type      `xml:"content"`
	Nopromo    string    `xml:"nopromo"`
	Autor      Author    `xml:"autor"`
	Link       []Link    `xml:"link"`
	Pos        string    `xml:"pos"`
	Type       string    `xml:"type"`
	Name       string    `xml:"name"`
	Firstname  string    `xml:"firstname"`
	Occupation string    `xml:"occupation"`
	Street     string    `xml:"street"`
	StreetNo   string    `xml:"streetno"`
	Zip        string    `xml:"zip"`
	City       string    `xml:"city"`
	Canton     string    `xml:"canton"`
	Phone      string    `xml:"phone"`
	Category   []string  `xml:"category"`
	Extra      []Type    `xml:"extra"`
}

Entry result entry

func (*Entry) AsResult

func (e *Entry) AsResult() search.Result

AsResult convert into a result

func (Entry) String

func (e Entry) String() string

type Feed

type Feed struct {
	XMLName      xml.Name  `xml:"feed"`
	Lang         string    `xml:"lang,attr"`
	Xmlns        string    `xml:"xmlns,attr"`
	OpenSearch   string    `xml:"openSearch,attr"`
	Tel          string    `xml:"tel,attr"`
	ID           string    `xml:"id"`
	Title        Type      `xml:"title"`
	Generator    Generator `xml:"generator"`
	Updated      string    `xml:"updated"`
	Link         []Link    `xml:"link"`
	ErrorCode    int       `xml:"errorCode,omitempty"`
	ErrorReason  string    `xml:"errorReason,omitempty"`
	ErrorMessage string    `xml:"errorMessage,omitempty"`
	TotalResults int       `xml:"totalResults"`
	StartIndex   int       `xml:"startIndex"`
	ItemsPerPage int       `xml:"itemsPerPage"`
	Query        Query     `xml:"Query"`
	Entry        []Entry   `xml:"entry"`
}

Feed result feed

type Generator

type Generator struct {
	Version float64 `xml:"version,attr"`
	URI     string  `xml:"uri,attr"`
}

Generator generator

type Link struct {
	Href  string `xml:"href,attr"`
	Title string `xml:"title,attr"`
	Rel   string `xml:"rel,attr"`
	Type  string `xml:"type,attr"`
}

Link link element

type Query

type Query struct {
	Role        string `xml:"role,attr"`
	SearchTerms string `xml:"searchTerms,attr"`
	StartPage   int    `xml:"startPage,attr"`
}

Query query element

type Type

type Type struct {
	Type string `xml:"type,attr"`
}

Type type element

Jump to

Keyboard shortcuts

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