instances

package
v0.0.0-...-3f4ef9c Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: GPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const USER_AGENT = "" /* 169-byte string literal not displayed */

Variables

This section is empty.

Functions

func FindRandomInstance

func FindRandomInstance(fetchedInstances *map[string]Instance, gradesEnabled []string, blacklist []string, torEnabled bool, torOnlyEnabled bool, minVersion version.Version, customInstances []string) (*string, bool)

Finds a random instance between the ones fetched according to user's choosen options.

func TorListening

func TorListening() (int, error)

Checks whether tor is listening on :9050 or :9150.

func Verify

func Verify(instanceUrl string, instance Instance) bool

Verifies an instance, using tor or not, by checking if it returns expected results from searches. It also removes instances using Cloudflare.

Types

type Instance

type Instance struct {
	Comments    []string `json:"comments"`
	NetworkType *string  `json:"network_type"`
	Error       *string  `json:"error,omit_empty"`
	Version     *string  `json:"version"`
	Html        *struct {
		Resources struct{} `json:"ressources"`
		Grade     string   `json:"grade"`
	} `json:"html,omit_empty"`
}

Struct representing an instance in the data fetched.

type InstancesData

type InstancesData struct {
	Instances map[string]Instance `json:"instances"`
}

The data fetched from searx.space.

func Fetch

func Fetch() (*InstancesData, error)

Fetches data from searx.space.

func InstancesNew

func InstancesNew(data io.ReadCloser) (*InstancesData, error)

Creates an InstancesData from the fetched JSON data.

Jump to

Keyboard shortcuts

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