cs

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithApiKey

func WithApiKey(apiKey string) coption

WithApiKey

func WithEngineID

func WithEngineID(engineID string) coption

WithEngineID sets the engine ID.

Types

type Answer

type Answer struct {
	Upvotecount string `json:"upvotecount"`
	Text        string `json:"text"`
	Datecreated string `json:"datecreated"`
	URL         string `json:"url"`
}

func (Answer) CreatedDate

func (a Answer) CreatedDate() (string, error)

type CSClient

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

func NewClient

func NewClient(ctx context.Context, opts ...coption) (*CSClient, error)

func (CSClient) Search

func (c CSClient) Search(query string) (*SearchResult, error)

type Item

type Item struct {
	Title   string `json:"title"`
	Link    string `json:"link"`
	Snippet string `json:"snippet"`
	Post    Post   `json:"pagemap"`
}

type Post

type Post struct {
	Question []Question `json:"question"`
	Answers  []Answer   `json:"answer"`
}

type Question

type Question struct {
	Upvotecount  string `json:"upvotecount"`
	Commentcount string `json:"commentcount"`
	Answercount  string `json:"answercount"`
	Name         string `json:"name"`
	Datecreated  string `json:"datecreated"`
	Text         string `json:"text"`
	URL          string `json:"url"`
}

type SearchResult

type SearchResult struct {
	Items []Item `json:"items"`
}

Jump to

Keyboard shortcuts

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