Documentation ¶
Index ¶
- type API
- func (api *API) DoGeolocationLookup() error
- func (api *API) GetGateways(p *GatewayParams) ([]*models.ModelsGateway, error)
- func (api *API) GetOpenVPNCert() (string, error)
- func (api *API) GetService() (*models.ModelsEIPService, error)
- func (api *API) SerializeConfig(params *GatewayParams) (string, error)
- type Config
- type GatewayParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) DoGeolocationLookup ¶
DoGeolocationLookup will try to fetch a valid country code from an online geolocation service (not controlled by us). This country code will be stored and sent in any subsequent resource queries to menshen (gateways/bridges), so that proximity is used in addition to the load information. This method should be called only once, right after initializing the API object.
func (*API) GetGateways ¶
func (api *API) GetGateways(p *GatewayParams) ([]*models.ModelsGateway, error)
GetGateways returns a list of gateways (it it's enabled by the menshen API). It optionally accepts a GatewayParams object where you can set different filters.
func (*API) GetOpenVPNCert ¶
GetOpenVPNCert returns valid OpenVPN client credentials (certificate and private key)
func (*API) GetService ¶
func (api *API) GetService() (*models.ModelsEIPService, error)
call menshen endpoint /service and return response TODO: rename endpoint and and this function TODO: split /service into multiple endpoints: locations, openvpn arguments, serial+version, auth
func (*API) SerializeConfig ¶
func (api *API) SerializeConfig(params *GatewayParams) (string, error)
SerializeConfig returns a single string containing a valid OpenVPN configuration file.
type Config ¶
type Config struct { // BaseCountry is an ISO-2 country code. If present, we will skip // geolocation lookup, and we will send our "base" country to menshen // when asking for gateways/bridges. BaseCountry string // Host we will connect to for API operations. Host string // Port we will connect to for API operations (default 443) Port int // Use TLS to connect to menshen (default: true) UseTLS bool // Introducer is an obfsucated introducer to use for all bootstrap operations. Introducer string // Proxy is a local SOCKS5 proxy for all bootstrap operations. Proxy string // ResolveWithDoH indicates whether we should use a DoH resolver. ResolveWithDoH bool }