moat

package
v0.0.0-...-d549e8d Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DistName = "moat"
)

Variables

View Source
var (
	NoTransportError = errors.New("No provided transport is available for this country")
)

Functions

This section is empty.

Types

type BridgeSettings

type BridgeSettings struct {
	Type          string   `json:"type"`
	Source        string   `json:"source"`
	BridgeStrings []string `json:"bridge_strings,omitempty"`
}

type CircumventionMap

type CircumventionMap map[string]CircumventionSettings

CircumventionMap maps countries to the CircumventionSettings that ara available on those countries

type CircumventionSettings

type CircumventionSettings struct {
	Settings []Settings `json:"settings"`
	Country  string     `json:"country,omitempty"`
}

type MoatDistributor

type MoatDistributor struct {

	// FetchBridges gets the list of builtin bridgelines from a remote url
	// the bridgeLines map is indexed by bridge type
	FetchBridges func(url string) (bridgeLines map[string][]string, err error)
	// contains filtered or unexported fields
}

func (*MoatDistributor) GetBridges

func (d *MoatDistributor) GetBridges(transport string, ip net.IP, country string) []string

func (*MoatDistributor) GetBuiltInBridges

func (d *MoatDistributor) GetBuiltInBridges(types []string) map[string][]string

func (*MoatDistributor) GetCircumventionDefaults

func (d *MoatDistributor) GetCircumventionDefaults(types []string, ip net.IP, shimToken, country string) (*CircumventionSettings, error)

func (*MoatDistributor) GetCircumventionMap

func (d *MoatDistributor) GetCircumventionMap() CircumventionMap

func (*MoatDistributor) GetCircumventionSettings

func (d *MoatDistributor) GetCircumventionSettings(country string, types []string, ip net.IP, shimToken string) (*CircumventionSettings, error)

func (*MoatDistributor) Init

func (d *MoatDistributor) Init(cfg *internal.Config)

func (*MoatDistributor) LoadCircumventionDefaults

func (d *MoatDistributor) LoadCircumventionDefaults(r io.Reader) error

func (*MoatDistributor) LoadCircumventionMap

func (d *MoatDistributor) LoadCircumventionMap(r io.Reader) error

func (*MoatDistributor) LoadDummyBridges

func (d *MoatDistributor) LoadDummyBridges(r io.Reader) error

func (*MoatDistributor) Shutdown

func (d *MoatDistributor) Shutdown()

type Settings

type Settings struct {
	Bridges BridgeSettings `json:"bridges"`
}

Jump to

Keyboard shortcuts

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