mockable

package
v0.0.0-...-bd88772 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package mockable contains mockable objects

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	MockableTestHelpers              map[string][]model.Service
	MockableHTTPClient               *http.Client
	MockableLogger                   model.Logger
	MockableMaybeResolverIP          string
	MockableProbeASNString           string
	MockableProbeCC                  string
	MockableProbeIP                  string
	MockableProbeNetworkName         string
	MockableProxyURL                 *url.URL
	MockableFetchPsiphonConfigResult []byte
	MockableFetchPsiphonConfigErr    error
	MockableFetchTorTargetsResult    map[string]model.TorTarget
	MockableFetchTorTargetsErr       error
	MockableFetchURLListResult       []model.URLInfo
	MockableFetchURLListErr          error
	MockableResolverIP               string
	MockableSoftwareName             string
	MockableSoftwareVersion          string
	MockableTempDir                  string
	MockableTorArgs                  []string
	MockableTorBinary                string
	MockableUserAgent                string
}

Session allows to mock sessions.

func (*Session) DefaultHTTPClient

func (sess *Session) DefaultHTTPClient() *http.Client

DefaultHTTPClient implements ExperimentSession.DefaultHTTPClient

func (*Session) FetchPsiphonConfig

func (sess *Session) FetchPsiphonConfig(ctx context.Context) ([]byte, error)

FetchPsiphonConfig implements ExperimentSession.FetchPsiphonConfig

func (*Session) FetchTorTargets

func (sess *Session) FetchTorTargets(
	ctx context.Context, cc string) (map[string]model.TorTarget, error)

FetchTorTargets implements ExperimentSession.TorTargets

func (*Session) FetchURLList

func (sess *Session) FetchURLList(
	ctx context.Context, config model.URLListConfig) ([]model.URLInfo, error)

FetchURLList implements ExperimentSession.FetchURLList.

func (*Session) GetTestHelpersByName

func (sess *Session) GetTestHelpersByName(name string) ([]model.Service, bool)

GetTestHelpersByName implements ExperimentSession.GetTestHelpersByName

func (*Session) KeyValueStore

func (sess *Session) KeyValueStore() model.KeyValueStore

KeyValueStore returns the configured key-value store.

func (*Session) Logger

func (sess *Session) Logger() model.Logger

Logger implements ExperimentSession.Logger

func (*Session) MaybeResolverIP

func (sess *Session) MaybeResolverIP() string

MaybeResolverIP implements ExperimentSession.MaybeResolverIP.

func (*Session) ProbeASNString

func (sess *Session) ProbeASNString() string

ProbeASNString implements ExperimentSession.ProbeASNString

func (*Session) ProbeCC

func (sess *Session) ProbeCC() string

ProbeCC implements ExperimentSession.ProbeCC

func (*Session) ProbeIP

func (sess *Session) ProbeIP() string

ProbeIP implements ExperimentSession.ProbeIP

func (*Session) ProbeNetworkName

func (sess *Session) ProbeNetworkName() string

ProbeNetworkName implements ExperimentSession.ProbeNetworkName

func (*Session) ProxyURL

func (sess *Session) ProxyURL() *url.URL

ProxyURL implements ExperimentSession.ProxyURL

func (*Session) ResolverIP

func (sess *Session) ResolverIP() string

ResolverIP implements ExperimentSession.ResolverIP

func (*Session) SoftwareName

func (sess *Session) SoftwareName() string

SoftwareName implements ExperimentSession.SoftwareName

func (*Session) SoftwareVersion

func (sess *Session) SoftwareVersion() string

SoftwareVersion implements ExperimentSession.SoftwareVersion

func (*Session) TempDir

func (sess *Session) TempDir() string

TempDir implements ExperimentSession.TempDir

func (*Session) TorArgs

func (sess *Session) TorArgs() []string

TorArgs implements ExperimentSession.TorArgs.

func (*Session) TorBinary

func (sess *Session) TorBinary() string

TorBinary implements ExperimentSession.TorBinary.

func (*Session) UserAgent

func (sess *Session) UserAgent() string

UserAgent implements ExperimentSession.UserAgent

Jump to

Keyboard shortcuts

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