Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIBridge ¶
type APIBridge struct { // Any authentication method needed for connect to the bridge, `none` // otherwise. Auth string `json:"auth,omitempty"` // Healthy indicates whether this bridge can be used normally. Healthy bool `json:"healthy,omitempty"` // Host is a unique identifier for the bridge. Host string `json:"host,omitempty"` // IP6Addr is the IPv6 address Ip6Addr string `json:"ip6_addr,omitempty"` // IPAddr is the IPv4 address IPAddr string `json:"ip_addr,omitempty"` // Load is the fractional load - but for now menshen agent is not measuring // load in the bridges. Load float64 `json:"load,omitempty"` // Location refers to the location to which this bridge points to Location string `json:"location,omitempty"` // Options contain the map of options that will be passed to the client. It usually // contains authentication credentials. Options interface{} `json:"options,omitempty"` // Overloaded should be set to true if the fractional load is above threshold. Overloaded bool `json:"overloaded,omitempty"` // For some protocols (like hopping) port is undefined. Port int64 `json:"port,omitempty"` // TCP, UDP or KCP. This was called "protocol" before. Transport string `json:"transport,omitempty"` // Type of bridge. Type string `json:"type,omitempty"` }
APIBridge api bridge
swagger:model api.Bridge
func (*APIBridge) ContextValidate ¶
ContextValidate validates this api bridge based on context it is used
func (*APIBridge) MarshalBinary ¶
MarshalBinary interface implementation
func (*APIBridge) UnmarshalBinary ¶
UnmarshalBinary interface implementation
type APIEIPService ¶
type APIEIPService struct { // auth Auth string `json:"auth,omitempty"` // locations Locations interface{} `json:"locations,omitempty"` // openvpn configuration OpenvpnConfiguration interface{} `json:"openvpn_configuration,omitempty"` // serial Serial int64 `json:"serial,omitempty"` // version Version int64 `json:"version,omitempty"` }
APIEIPService api e IP service
swagger:model api.EIPService
func (*APIEIPService) ContextValidate ¶
ContextValidate validates this api e IP service based on context it is used
func (*APIEIPService) MarshalBinary ¶
func (m *APIEIPService) MarshalBinary() ([]byte, error)
MarshalBinary interface implementation
func (*APIEIPService) UnmarshalBinary ¶
func (m *APIEIPService) UnmarshalBinary(b []byte) error
UnmarshalBinary interface implementation
func (*APIEIPService) Validate ¶
func (m *APIEIPService) Validate(formats strfmt.Registry) error
Validate validates this api e IP service
type APIGateway ¶
type APIGateway struct { // Not used now - we could potentially flag gateways that are planned // to undergo maintenance mode some time in advance. // We can also automatically flag as not healthy gateways that appear // not to be routing to the internet. Healthy bool `json:"healthy,omitempty"` // Host is a unique identifier for the gateway host. It does not need to resolve, since // we're not using DNS to resolve the gateways. Host string `json:"host,omitempty"` // IP6Addr is the IPv6 address Ip6Addr string `json:"ip6_addr,omitempty"` // IPAddr is the IPv4 address IPAddr string `json:"ip_addr,omitempty"` // Load is the fractional load received from the menshen agent. For the // time being it only makes Load float64 `json:"load,omitempty"` // Location is the canonical label for the location of the gateway. Location string `json:"location,omitempty"` // Overloaded should be set to true if the fractional load is above threshold. Overloaded bool `json:"overloaded,omitempty"` // The (primary) port this gateway is listening on. Port int64 `json:"port,omitempty"` // TCP, UDP or KCP. This was called "protocol" in previous versions of the API. Transport string `json:"transport,omitempty"` // Type is the type of gateway. The only valid type as of 2023 is openvpn. Type string `json:"type,omitempty"` }
APIGateway api gateway
swagger:model api.Gateway
func (*APIGateway) ContextValidate ¶
ContextValidate validates this api gateway based on context it is used
func (*APIGateway) MarshalBinary ¶
func (m *APIGateway) MarshalBinary() ([]byte, error)
MarshalBinary interface implementation
func (*APIGateway) UnmarshalBinary ¶
func (m *APIGateway) UnmarshalBinary(b []byte) error
UnmarshalBinary interface implementation
func (*APIGateway) Validate ¶
func (m *APIGateway) Validate(formats strfmt.Registry) error
Validate validates this api gateway
type APIGateways ¶
type APIGateways struct { // all All string `json:"all,omitempty"` // location Location string `json:"location,omitempty"` }
APIGateways api gateways
swagger:model api.Gateways
func (*APIGateways) ContextValidate ¶
ContextValidate validates this api gateways based on context it is used
func (*APIGateways) MarshalBinary ¶
func (m *APIGateways) MarshalBinary() ([]byte, error)
MarshalBinary interface implementation
func (*APIGateways) UnmarshalBinary ¶
func (m *APIGateways) UnmarshalBinary(b []byte) error
UnmarshalBinary interface implementation
func (*APIGateways) Validate ¶
func (m *APIGateways) Validate(formats strfmt.Registry) error
Validate validates this api gateways
type APILocation ¶
type APILocation struct { // country code CountryCode string `json:"country_code,omitempty"` // hemisphere Hemisphere string `json:"hemisphere,omitempty"` // lat Lat string `json:"lat,omitempty"` // lon Lon string `json:"lon,omitempty"` // name Name string `json:"name,omitempty"` // timezone Timezone string `json:"timezone,omitempty"` }
APILocation api location
swagger:model api.Location
func (*APILocation) ContextValidate ¶
ContextValidate validates this api location based on context it is used
func (*APILocation) MarshalBinary ¶
func (m *APILocation) MarshalBinary() ([]byte, error)
MarshalBinary interface implementation
func (*APILocation) UnmarshalBinary ¶
func (m *APILocation) UnmarshalBinary(b []byte) error
UnmarshalBinary interface implementation
func (*APILocation) Validate ¶
func (m *APILocation) Validate(formats strfmt.Registry) error
Validate validates this api location
type MainGateways ¶
type MainGateways struct { // all All string `json:"all,omitempty"` // location Location string `json:"location,omitempty"` }
MainGateways main gateways
swagger:model main.Gateways
func (*MainGateways) ContextValidate ¶
ContextValidate validates this main gateways based on context it is used
func (*MainGateways) MarshalBinary ¶
func (m *MainGateways) MarshalBinary() ([]byte, error)
MarshalBinary interface implementation
func (*MainGateways) UnmarshalBinary ¶
func (m *MainGateways) UnmarshalBinary(b []byte) error
UnmarshalBinary interface implementation
func (*MainGateways) Validate ¶
func (m *MainGateways) Validate(formats strfmt.Registry) error
Validate validates this main gateways
type ModelsBridge ¶
type ModelsBridge struct { // Any authentication method needed for connect to the bridge, `none` // otherwise. Auth string `json:"auth,omitempty"` // Bucket is a "bucket" tag that connotes a resource group that a user may or may not // have access to. An empty bucket string implies that it is open access Bucket string `json:"bucket,omitempty"` // An experimental bridge flags any bridge that, for whatever reason, // is not deemed stable. The expectation is that clients have to opt-in to // experimental bridges (and gateways too). Experimental bool `json:"experimental,omitempty"` // Healthy indicates whether this bridge can be used normally. Healthy bool `json:"healthy,omitempty"` // Host is a unique identifier for the bridge. Host string `json:"host,omitempty"` // IP6Addr is the IPv6 address Ip6Addr string `json:"ip6_addr,omitempty"` // IPAddr is the IPv4 address IPAddr string `json:"ip_addr,omitempty"` // LastSeenMillis is a unix time in milliseconds representing the last time we received a heartbeat update from this bridge LastSeenMillis int64 `json:"last_seen_millis,omitempty"` // Load is the fractional load - but for now menshen agent is not measuring // load in the bridges. Load float64 `json:"load,omitempty"` // Location refers to the location to which this bridge points to Location string `json:"location,omitempty"` // Options contain the map of options that will be passed to the client. It usually // contains authentication credentials. Options map[string]interface{} `json:"options,omitempty"` // Overloaded should be set to true if the fractional load is above threshold. Overloaded bool `json:"overloaded,omitempty"` // For some protocols (like hopping) port is undefined. Port int64 `json:"port,omitempty"` // TCP, UDP or KCP. This was called "protocol" before. Transport string `json:"transport,omitempty"` // Type of bridge. Type string `json:"type,omitempty"` }
ModelsBridge models bridge
swagger:model models.Bridge
func (*ModelsBridge) ContextValidate ¶
ContextValidate validates this models bridge based on context it is used
func (*ModelsBridge) MarshalBinary ¶
func (m *ModelsBridge) MarshalBinary() ([]byte, error)
MarshalBinary interface implementation
func (*ModelsBridge) UnmarshalBinary ¶
func (m *ModelsBridge) UnmarshalBinary(b []byte) error
UnmarshalBinary interface implementation
func (*ModelsBridge) Validate ¶
func (m *ModelsBridge) Validate(formats strfmt.Registry) error
Validate validates this models bridge
type ModelsEIPService ¶
type ModelsEIPService struct { // auth Auth string `json:"auth,omitempty"` // locations Locations map[string]ModelsLocation `json:"locations,omitempty"` // openvpn configuration OpenvpnConfiguration map[string]interface{} `json:"openvpn_configuration,omitempty"` // serial Serial int64 `json:"serial,omitempty"` // version Version int64 `json:"version,omitempty"` }
ModelsEIPService models e IP service
swagger:model models.EIPService
func (*ModelsEIPService) ContextValidate ¶
ContextValidate validate this models e IP service based on the context it is used
func (*ModelsEIPService) MarshalBinary ¶
func (m *ModelsEIPService) MarshalBinary() ([]byte, error)
MarshalBinary interface implementation
func (*ModelsEIPService) UnmarshalBinary ¶
func (m *ModelsEIPService) UnmarshalBinary(b []byte) error
UnmarshalBinary interface implementation
func (*ModelsEIPService) Validate ¶
func (m *ModelsEIPService) Validate(formats strfmt.Registry) error
Validate validates this models e IP service
type ModelsGateway ¶
type ModelsGateway struct { // Bucket is a "bucket" tag that connotes a resource group that a user may or may not // have access to. An empty bucket string implies that it is open access Bucket string `json:"bucket,omitempty"` // An experimental gateway flags any gateway that, for whatever reason, // is not deemed stable. The expectation is that clients have to opt-in to // experimental gateways (and bridges too). Experimental bool `json:"experimental,omitempty"` // Not used now - we could potentially flag gateways that are planned // to undergo maintenance mode some time in advance. // We can also automatically flag as not healthy gateways that appear // not to be routing to the internet. Healthy bool `json:"healthy,omitempty"` // Host is a unique identifier for the gateway host. It does not need to resolve, since // we're not using DNS to resolve the gateways. Host string `json:"host,omitempty"` // IP6Addr is the IPv6 address Ip6Addr string `json:"ip6_addr,omitempty"` // IPAddr is the IPv4 address IPAddr string `json:"ip_addr,omitempty"` // LastSeenMillis is a unix time in milliseconds representing the last time we received a heartbeat update from this gateway LastSeenMillis int64 `json:"last_seen_millis,omitempty"` // Load is the fractional load received from the menshen agent. For the // time being it is a synthethic metric that takes into account number of clients // and network information for the node. Load float64 `json:"load,omitempty"` // Location is the canonical label for the location of the gateway. Location string `json:"location,omitempty"` // Overloaded should be set to true if the fractional load is above threshold. Overloaded bool `json:"overloaded,omitempty"` // The (primary) port this gateway is listening on. Port int64 `json:"port,omitempty"` // TCP, UDP, KCP or Quic. This was called "protocol" in previous versions of the API. Transport string `json:"transport,omitempty"` // Type is the type of gateway. The only valid type as of 2023 is openvpn. Type string `json:"type,omitempty"` }
ModelsGateway models gateway
swagger:model models.Gateway
func (*ModelsGateway) ContextValidate ¶
ContextValidate validates this models gateway based on context it is used
func (*ModelsGateway) MarshalBinary ¶
func (m *ModelsGateway) MarshalBinary() ([]byte, error)
MarshalBinary interface implementation
func (*ModelsGateway) UnmarshalBinary ¶
func (m *ModelsGateway) UnmarshalBinary(b []byte) error
UnmarshalBinary interface implementation
func (*ModelsGateway) Validate ¶
func (m *ModelsGateway) Validate(formats strfmt.Registry) error
Validate validates this models gateway
type ModelsLocation ¶
type ModelsLocation struct { // CountryCode is the two-character country ISO identifier (uppercase). CountryCode string `json:"country_code,omitempty"` // DisplayName is the user-facing string for a given location. DisplayName string `json:"display_name,omitempty"` // Any location that has at least one bridge configured will set this to true. HasBridges bool `json:"has_bridges,omitempty"` // TODO Not used right now, but intended to signal when a location has all of their // nodes overwhelmed. Healthy bool `json:"healthy,omitempty"` // Hemisphere is a legacy label for a gateway. The rationale was once // intended to be to allocate gateways for an hemisphere with certain // regional "fairness", even if they're geographically located in a // different region. We might want to set this on the Gateway or Bridge, not in the // Location itself... Hemisphere string `json:"hemisphere,omitempty"` // Label is the short representation of a location, used internally. Label string `json:"label,omitempty"` // Lat is the latitude for the location. Lat string `json:"lat,omitempty"` // Lon is the longitude for the location. Lon string `json:"lon,omitempty"` // Region is the continental region this gateway is assigned to. Not used at the moment, // intended to use a label from the 7-continent model. Region string `json:"region,omitempty"` // Timezone is the TZ for the location (-1, 0, +1, ...) Timezone string `json:"timezone,omitempty"` }
ModelsLocation models location
swagger:model models.Location
func (*ModelsLocation) ContextValidate ¶
ContextValidate validates this models location based on context it is used
func (*ModelsLocation) MarshalBinary ¶
func (m *ModelsLocation) MarshalBinary() ([]byte, error)
MarshalBinary interface implementation
func (*ModelsLocation) UnmarshalBinary ¶
func (m *ModelsLocation) UnmarshalBinary(b []byte) error
UnmarshalBinary interface implementation
func (*ModelsLocation) Validate ¶
func (m *ModelsLocation) Validate(formats strfmt.Registry) error
Validate validates this models location
type ModelsProvider ¶
type ModelsProvider struct { // URL of the API endpoints APIURI string `json:"api_uri,omitempty"` // oldest supported api version // deprecated: kept for backwards compatibility. Replaced by api_versions. APIVersion string `json:"api_version,omitempty"` // all API versions the provider supports APIVersions []string `json:"api_versions"` // Flag indicating whether to show regularly a donation reminder AskForDonations bool `json:"ask_for_donations,omitempty"` // fingerprint of CA cert used to setup TLS sessions during VPN setup (and up to API version 3 for API communication) // deprecated: kept for backwards compatibility CaCertFingerprint string `json:"ca_cert_fingerprint,omitempty"` // URL to fetch the CA cert used to setup TLS sessions during VPN setup (and up to API version 3 for API communication) // deprecated: kept for backwards compatibility CaCertURI string `json:"ca_cert_uri,omitempty"` // URL of a service that returns a country code for an ip address. If empty, // OONI backend is used CountryCodeLookupURL string `json:"country_code_lookup_url,omitempty"` // Default language this provider uses to show infos and provider messages DefaultLanguage string `json:"default_language,omitempty"` // Short description about the provider Description map[string]string `json:"description,omitempty"` // Domain of the provider Domain string `json:"domain,omitempty"` // Number of days until a donation reminder reappears DonatePeriod string `json:"donate_period,omitempty"` // URL to the donation website DonateURL string `json:"donate_url,omitempty"` // URL to general provider website InfoURL string `json:"info_url,omitempty"` // Languages the provider supports to show infos and provider messages Languages []string `json:"languages"` // URL to the message of the day service MotdURL string `json:"motd_url,omitempty"` // Provider name Name map[string]string `json:"name,omitempty"` // service Service *ModelsProviderService `json:"service,omitempty"` // List of services the provider offers, currently only openvpn Services []string `json:"services"` // list of STUN servers (format: ip/hostname:port) servers to get current ip address // can consist of self hosted STUN servers, public ones or a combination of both. // GeolocationLookup is only done when the list of STUNServers is not empty StunServers []string `json:"stun_servers"` // URL to Terms of Service website TosURL string `json:"tos_url,omitempty"` }
ModelsProvider models provider
swagger:model models.Provider
func (*ModelsProvider) ContextValidate ¶
ContextValidate validate this models provider based on the context it is used
func (*ModelsProvider) MarshalBinary ¶
func (m *ModelsProvider) MarshalBinary() ([]byte, error)
MarshalBinary interface implementation
func (*ModelsProvider) UnmarshalBinary ¶
func (m *ModelsProvider) UnmarshalBinary(b []byte) error
UnmarshalBinary interface implementation
func (*ModelsProvider) Validate ¶
func (m *ModelsProvider) Validate(formats strfmt.Registry) error
Validate validates this models provider
type ModelsProviderService ¶
type ModelsProviderService struct { // Flag indicating if anonymous usage without registration is allowed // deprecated: kept for backwards compatibility AllowAnonymous bool `json:"allow_anonymous,omitempty"` // Flag indicating if the provider supports user registration // deprecated: kept for backwards compatibility AllowRegistration bool `json:"allow_registration,omitempty"` }
ModelsProviderService Operational properties which describe how the provider offers the service
swagger:model ModelsProviderService
func (*ModelsProviderService) ContextValidate ¶
ContextValidate validates this models provider service based on context it is used
func (*ModelsProviderService) MarshalBinary ¶
func (m *ModelsProviderService) MarshalBinary() ([]byte, error)
MarshalBinary interface implementation
func (*ModelsProviderService) UnmarshalBinary ¶
func (m *ModelsProviderService) UnmarshalBinary(b []byte) error
UnmarshalBinary interface implementation
func (*ModelsProviderService) Validate ¶
func (m *ModelsProviderService) Validate(formats strfmt.Registry) error
Validate validates this models provider service