marginalia

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: CC0-1.0 Imports: 6 Imported by: 0

Documentation

Overview

Package marginalia implements the Marginalia search API.

You need an API key to use this. See the Marginalia API docs for more information: https://www.marginalia.nu/marginalia-search/api/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(apiKey string, httpCli *http.Client) *Client

func (*Client) Search

func (c *Client) Search(ctx context.Context, req *Request) (*Response, error)

type Detail

type Detail struct {
	Keyword          string   `json:"keyword"`
	Count            int      `json:"count"`
	FlagsUnstableAPI []string `json:"flagsUnstableAPI"`
}

type Request

type Request struct {
	Query string
	Count *int
	Index *int
}

type Response

type Response struct {
	License string   `json:"license"`
	Query   string   `json:"query"`
	Results []Result `json:"results"`
}

type Result

type Result struct {
	URL         string     `json:"url"`
	Title       string     `json:"title"`
	Description string     `json:"description"`
	Quality     float64    `json:"quality"`
	Details     [][]Detail `json:"details"`
}

Jump to

Keyboard shortcuts

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