server

package
v0.0.0-...-be0919c Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2018 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	RegisterIdentity(id identity.Identity, signer identity.Signer) (err error)

	FindProposals(providerID string) (proposals []dto_discovery.ServiceProposal, err error)
	RegisterProposal(proposal dto_discovery.ServiceProposal, signer identity.Signer) (err error)
	UnregisterProposal(proposal dto_discovery.ServiceProposal, signer identity.Signer) (err error)
	PingProposal(proposal dto_discovery.ServiceProposal, signer identity.Signer) (err error)

	SendSessionStats(sessionId session.ID, sessionStats dto.SessionStats, signer identity.Signer) (err error)
}

Client is interface how to access Mysterium API

func NewClient

func NewClient(discoveryAPIAddress string) Client

NewClient creates Mysterium centralized api instance with real communication

type ClientFake

type ClientFake struct {
	RegisteredIdentity identity.Identity
	// contains filtered or unexported fields
}

ClientFake is fake client to Mysterium API

func NewClientFake

func NewClientFake() *ClientFake

NewClientFake constructs fake API client

func (*ClientFake) FindProposals

func (client *ClientFake) FindProposals(providerID string) (proposals []dto_discovery.ServiceProposal, err error)

FindProposals fetches announced proposals by given filters

func (*ClientFake) PingProposal

func (client *ClientFake) PingProposal(proposal dto_discovery.ServiceProposal, signer identity.Signer) (err error)

PingProposal heartbeats that service proposal is still active

func (*ClientFake) RegisterIdentity

func (client *ClientFake) RegisterIdentity(id identity.Identity, signer identity.Signer) (err error)

RegisterIdentity announces that new identity was created

func (*ClientFake) RegisterProposal

func (client *ClientFake) RegisterProposal(proposal dto_discovery.ServiceProposal, signer identity.Signer) (err error)

RegisterProposal announces service proposal

func (*ClientFake) SendSessionStats

func (client *ClientFake) SendSessionStats(sessionId session.ID, sessionStats dto.SessionStats, signer identity.Signer) (err error)

SendSessionStats heartbeats that session is still active + session upload and download amounts

func (*ClientFake) UnregisterProposal

func (client *ClientFake) UnregisterProposal(proposal dto_discovery.ServiceProposal, signer identity.Signer) error

UnregisterProposal unregisters a service proposal when client disconnects

type HTTPTransport

type HTTPTransport interface {
	Do(*http.Request) (*http.Response, error)
}

HTTPTransport interface with single method do is extracted from net/transport.Client structure

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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