mysterium

package
v0.0.0-...-365054f Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MysteriumAPI

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

MysteriumAPI provides access to Mysterium owned central discovery service.

func NewClient

func NewClient(httpClient *requests.HTTPClient, discoveryAPIAddress string) *MysteriumAPI

NewClient creates a Discovery client.

func (*MysteriumAPI) GetPricing

func (mApi *MysteriumAPI) GetPricing() (market.LatestPrices, error)

GetPricing gets the pricing from discovery.

func (*MysteriumAPI) QueryCountries

func (mApi *MysteriumAPI) QueryCountries(query ProposalsQuery) (map[string]int, error)

QueryCountries returns active service proposals number per country.

func (*MysteriumAPI) QueryProposals

func (mApi *MysteriumAPI) QueryProposals(query ProposalsQuery) ([]market.ServiceProposal, error)

QueryProposals returns active service proposals.

type ProposalsQuery

type ProposalsQuery struct {
	ProviderID      string
	ProviderIDs     []string
	ServiceType     string
	LocationCountry string

	CompatibilityMin, CompatibilityMax int
	AccessPolicy, AccessPolicySource   string

	IPType                  string
	NATCompatibility        nat.NATType
	BandwidthMin            float64
	QualityMin              float32
	IncludeMonitoringFailed bool
	PresetID                int
}

ProposalsQuery represents URL query for proposal listing

func (ProposalsQuery) ToURLValues

func (q ProposalsQuery) ToURLValues() url.Values

ToURLValues converts the query to url.Values.

Jump to

Keyboard shortcuts

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