Documentation ¶
Index ¶
- Constants
- func GetServiceTypes() ([]byte, error)
- func NewWireGuardConnection(opts wireGuardOptions, device wireguardDevice, ipResolver ip.Resolver, ...) (connection.Connection, error)
- func SetFlagLauncherVersion(val string)
- type BalanceChangeCallback
- type BuildInfo
- type ConnectRequest
- type ConnectResponse
- type ConnectionStatusChangeCallback
- type ConsumerPaymentConfig
- type CreatePaymentGatewayOrderReq
- type Estimates
- type GatewayClientCallbackReq
- type GatewaysResponse
- type GetBalanceRequest
- type GetBalanceResponse
- type GetGatewaysRequest
- type GetIdentityRegistrationFeesResponse
- type GetIdentityRequest
- type GetIdentityResponse
- type GetLocationResponse
- type GetPaymentOrderRequest
- type GetProposalRequest
- type GetProposalsRequest
- type GetStatusResponse
- type HealthCheckData
- type IdentityRegistrationChangeCallback
- type ListOrdersRequest
- type MigrationStatus
- type MigrationStatusResponse
- type MobileNode
- func (mb *MobileNode) CalculateEstimates(amount float64) *Estimates
- func (mb *MobileNode) Connect(req *ConnectRequest) *ConnectResponse
- func (mb *MobileNode) CreatePaymentGatewayOrder(req *CreatePaymentGatewayOrderReq) ([]byte, error)
- func (mb *MobileNode) Disconnect() error
- func (mb *MobileNode) ExchangeRate(quote string) (float64, error)
- func (mb *MobileNode) ExportIdentity(identityAddress, newPassphrase string) ([]byte, error)
- func (mb *MobileNode) ForceBalanceUpdate(req *GetBalanceRequest) *GetBalanceResponse
- func (mb *MobileNode) GatewayClientCallback(req *GatewayClientCallbackReq) error
- func (mb *MobileNode) GetAllServicesState() ([]byte, error)
- func (mb *MobileNode) GetBalance(req *GetBalanceRequest) (*GetBalanceResponse, error)
- func (mb *MobileNode) GetCountries(req *GetProposalsRequest) ([]byte, error)
- func (mb *MobileNode) GetDefaultCurrency() string
- func (mb *MobileNode) GetGateways(req *GetGatewaysRequest) ([]byte, error)
- func (mb *MobileNode) GetIdentity(req *GetIdentityRequest) (*GetIdentityResponse, error)
- func (mb *MobileNode) GetIdentityRegistrationFees() (*GetIdentityRegistrationFeesResponse, error)
- func (mb *MobileNode) GetLocation() (*GetLocationResponse, error)
- func (mb *MobileNode) GetNATType() (string, error)
- func (mb *MobileNode) GetPaymentGatewayOrder(req *GetPaymentOrderRequest) ([]byte, error)
- func (mb *MobileNode) GetPaymentGatewayOrderInvoice(req *GetPaymentOrderRequest) ([]byte, error)
- func (mb *MobileNode) GetProposals(req *GetProposalsRequest) ([]byte, error)
- func (mb *MobileNode) GetProposalsByPreset(presetID int) ([]byte, error)
- func (mb *MobileNode) GetStatus() ([]byte, error)
- func (mb *MobileNode) GetUnsettledEarnings(req *GetBalanceRequest) (*GetBalanceResponse, error)
- func (mb *MobileNode) HealthCheck() *HealthCheckData
- func (mb *MobileNode) ImportIdentity(data []byte, passphrase string) (string, error)
- func (mb *MobileNode) IsFreeRegistrationEligible(identityAddress string) (bool, error)
- func (mb *MobileNode) ListConsumerSessions(filter *SessionFilter) ([]byte, error)
- func (mb *MobileNode) ListPaymentGatewayOrders(req *ListOrdersRequest) ([]byte, error)
- func (mb *MobileNode) ListProposalFilterPresets() ([]byte, error)
- func (mb *MobileNode) MigrateHermes(id string) error
- func (mb *MobileNode) MigrateHermesStatus(id string) ([]byte, error)
- func (mb *MobileNode) OverrideWireguardConnection(wgTunnelSetup WireguardTunnelSetup)
- func (mb *MobileNode) Reconnect(req *ConnectRequest) *ConnectResponse
- func (mb *MobileNode) RegisterBalanceChangeCallback(cb BalanceChangeCallback)
- func (mb *MobileNode) RegisterConnectionStatusChangeCallback(cb ConnectionStatusChangeCallback)
- func (mb *MobileNode) RegisterIdentity(req *RegisterIdentityRequest) error
- func (mb *MobileNode) RegisterIdentityRegistrationChangeCallback(cb IdentityRegistrationChangeCallback)
- func (mb *MobileNode) RegisterOrderUpdatedCallback(cb OrderUpdatedCallback)
- func (mb *MobileNode) RegisterServiceStatusChangeCallback(cb ServiceStatusChangeCallback)
- func (mb *MobileNode) RegisterStatisticsChangeCallback(cb StatisticsChangeCallback)
- func (mb *MobileNode) RegistrationTokenReward(token string) (float64, error)
- func (mb *MobileNode) ResidentCountry() string
- func (mb *MobileNode) SendFeedback(req *SendFeedbackRequest) error
- func (mb *MobileNode) SetUserConfig(key, value string) error
- func (mb *MobileNode) Shutdown() error
- func (mb *MobileNode) StartProvider()
- func (mb *MobileNode) StopProvider()
- func (mb *MobileNode) UpdateResidentCountry(r *ResidentCountryUpdateRequest) error
- func (mb *MobileNode) WaitUntilDies() error
- type MobileNodeOptions
- type OrderUpdatedCallback
- type OrderUpdatedCallbackPayload
- type PaymentOrderOptions
- type PaymentOrderResponse
- type ProposalChangeCallback
- type ProposalFilterPreset
- type RegisterIdentityRequest
- type ResidentCountryUpdateRequest
- type SendFeedbackRequest
- type ServiceStatusChangeCallback
- type ServicesState
- type SessionDTO
- type SessionFilter
- type SessionStorage
- type StatisticsChangeCallback
- type WireguardTunnelSetup
Constants ¶
const ( // MigrationStatusRequired means new there is new Hermes and identity required to migrate to it MigrationStatusRequired = "required" // MigrationStatusFinished means migration to new Hermes finished or not needed MigrationStatusFinished = "finished" )
const AutoNATType = "auto"
AutoNATType passed as NATCompatibility parameter in proposal request indicates NAT type should be probed automatically immediately within given request
Variables ¶
This section is empty.
Functions ¶
func GetServiceTypes ¶
GetServiceTypes returns all possible service types
func NewWireGuardConnection ¶
func NewWireGuardConnection(opts wireGuardOptions, device wireguardDevice, ipResolver ip.Resolver, handshakeWaiter wireguard_connection.HandshakeWaiter) (connection.Connection, error)
NewWireGuardConnection creates a new wireguard connection
func SetFlagLauncherVersion ¶
func SetFlagLauncherVersion(val string)
SetFlagLauncherVersion sets LauncherVersion flag value, which is reported to Prometheus
Types ¶
type BalanceChangeCallback ¶
BalanceChangeCallback represents balance change callback.
type BuildInfo ¶
type BuildInfo struct { Commit string `json:"commit"` Branch string `json:"branch"` BuildNumber string `json:"build_number"` }
BuildInfo represents node build info.
type ConnectRequest ¶
type ConnectRequest struct { Providers string // comma separated list of providers that will be used for the connection. IdentityAddress string ServiceType string CountryCode string IPType string SortBy string DNSOption string IncludeMonitoringFailed bool }
ConnectRequest represents connect request.
- DNSOption:
- - "auto" (default) tries the following with fallbacks: provider's DNS -> client's system DNS -> public DNS
- - "provider" uses DNS servers from provider's system configuration
- - "system" uses DNS servers from client's system configuration
type ConnectResponse ¶
ConnectResponse represents connect response with optional error code and message.
type ConnectionStatusChangeCallback ¶
type ConnectionStatusChangeCallback interface {
OnChange(status string)
}
ConnectionStatusChangeCallback represents status callback.
type ConsumerPaymentConfig ¶
ConsumerPaymentConfig defines consumer side payment configuration
type CreatePaymentGatewayOrderReq ¶
type CreatePaymentGatewayOrderReq struct { IdentityAddress string Gateway string MystAmount string AmountUSD string PayCurrency string Country string State string // GatewayCallerData is marshaled json that is accepting by the payment gateway. GatewayCallerData []byte }
CreatePaymentGatewayOrderReq is used to create a new order.
type Estimates ¶
type Estimates struct { VideoMinutes int64 MusicMinutes int64 BrowsingMinutes int64 TrafficMB int64 PricePerGB float64 PricePerMin float64 }
Estimates represent estimated entertainment
type GatewayClientCallbackReq ¶
type GatewayClientCallbackReq struct { IdentityAddress string Gateway string GooglePurchaseToken string GoogleProductID string }
GatewayClientCallbackReq is the payload for GatewayClientCallback.
type GatewaysResponse ¶
type GatewaysResponse struct { Name string `json:"name"` OrderOptions PaymentOrderOptions `json:"order_options"` Currencies []string `json:"currencies"` }
GatewaysResponse represents a respose which cointains gateways and their data.
type GetBalanceRequest ¶
type GetBalanceRequest struct {
IdentityAddress string
}
GetBalanceRequest represents balance request.
type GetBalanceResponse ¶
type GetBalanceResponse struct {
Balance float64
}
GetBalanceResponse represents balance response.
type GetGatewaysRequest ¶
type GetGatewaysRequest struct {
OptionsCurrency string
}
GetGatewaysRequest request for GetGateways.
type GetIdentityRegistrationFeesResponse ¶
type GetIdentityRegistrationFeesResponse struct {
Fee float64
}
GetIdentityRegistrationFeesResponse represents identity registration fees result.
type GetIdentityRequest ¶
GetIdentityRequest represents identity request.
type GetIdentityResponse ¶
type GetIdentityResponse struct { IdentityAddress string ChannelAddress string RegistrationStatus string }
GetIdentityResponse represents identity response.
type GetLocationResponse ¶
GetLocationResponse represents location response.
type GetPaymentOrderRequest ¶
GetPaymentOrderRequest a request to get an order.
type GetProposalRequest ¶
GetProposalRequest represents proposal request.
type GetProposalsRequest ¶
type GetProposalsRequest struct { ServiceType string LocationCountry string IPType string Refresh bool PriceHourMax float64 PriceGiBMax float64 QualityMin float32 PresetID int NATCompatibility string }
GetProposalsRequest represents proposals request.
type GetStatusResponse ¶
type GetStatusResponse struct { State string Proposal proposalDTO }
GetStatusResponse represents status response.
type HealthCheckData ¶
type HealthCheckData struct { Uptime string `json:"uptime"` Version string `json:"version"` BuildInfo *BuildInfo `json:"build_info"` }
HealthCheckData represents node health check info.
type IdentityRegistrationChangeCallback ¶
type IdentityRegistrationChangeCallback interface {
OnChange(identityAddress string, status string)
}
IdentityRegistrationChangeCallback represents identity registration status callback.
type ListOrdersRequest ¶
type ListOrdersRequest struct {
IdentityAddress string
}
ListOrdersRequest a request to list orders.
type MigrationStatusResponse ¶
type MigrationStatusResponse struct {
Status MigrationStatus `json:"status"`
}
MigrationStatusResponse represents status of the migration
type MobileNode ¶
type MobileNode struct {
// contains filtered or unexported fields
}
MobileNode represents node object tuned for mobile device.
func NewNode ¶
func NewNode(appPath string, options *MobileNodeOptions) (*MobileNode, error)
NewNode function creates new Node.
func (*MobileNode) CalculateEstimates ¶
func (mb *MobileNode) CalculateEstimates(amount float64) *Estimates
CalculateEstimates calculates average service times
func (*MobileNode) Connect ¶
func (mb *MobileNode) Connect(req *ConnectRequest) *ConnectResponse
Connect connects to given provider.
func (*MobileNode) CreatePaymentGatewayOrder ¶
func (mb *MobileNode) CreatePaymentGatewayOrder(req *CreatePaymentGatewayOrderReq) ([]byte, error)
CreatePaymentGatewayOrder creates a payment order.
func (*MobileNode) Disconnect ¶
func (mb *MobileNode) Disconnect() error
Disconnect disconnects or cancels current connection.
func (*MobileNode) ExchangeRate ¶
func (mb *MobileNode) ExchangeRate(quote string) (float64, error)
ExchangeRate returns MYST rate in quote currency.
func (*MobileNode) ExportIdentity ¶
func (mb *MobileNode) ExportIdentity(identityAddress, newPassphrase string) ([]byte, error)
ExportIdentity exports a given identity address encrypting it with the new passphrase.
func (*MobileNode) ForceBalanceUpdate ¶
func (mb *MobileNode) ForceBalanceUpdate(req *GetBalanceRequest) *GetBalanceResponse
ForceBalanceUpdate force updates balance and returns the updated balance.
func (*MobileNode) GatewayClientCallback ¶
func (mb *MobileNode) GatewayClientCallback(req *GatewayClientCallbackReq) error
GatewayClientCallback triggers payment callback for google from client side.
func (*MobileNode) GetAllServicesState ¶
func (mb *MobileNode) GetAllServicesState() ([]byte, error)
GetAllServicesState returns state of all services
func (*MobileNode) GetBalance ¶
func (mb *MobileNode) GetBalance(req *GetBalanceRequest) (*GetBalanceResponse, error)
GetBalance returns current balance.
func (*MobileNode) GetCountries ¶
func (mb *MobileNode) GetCountries(req *GetProposalsRequest) ([]byte, error)
GetCountries returns service proposals number per country from API. go mobile does not support complex slices.
func (*MobileNode) GetDefaultCurrency ¶
func (mb *MobileNode) GetDefaultCurrency() string
GetDefaultCurrency returns the current default currency set.
func (*MobileNode) GetGateways ¶
func (mb *MobileNode) GetGateways(req *GetGatewaysRequest) ([]byte, error)
GetGateways returns possible payment gateways.
func (*MobileNode) GetIdentity ¶
func (mb *MobileNode) GetIdentity(req *GetIdentityRequest) (*GetIdentityResponse, error)
GetIdentity finds first identity and unlocks it. If there is no identity default one will be created.
func (*MobileNode) GetIdentityRegistrationFees ¶
func (mb *MobileNode) GetIdentityRegistrationFees() (*GetIdentityRegistrationFeesResponse, error)
GetIdentityRegistrationFees returns identity registration fees.
func (*MobileNode) GetLocation ¶
func (mb *MobileNode) GetLocation() (*GetLocationResponse, error)
GetLocation return current location including country and IP.
func (*MobileNode) GetNATType ¶
func (mb *MobileNode) GetNATType() (string, error)
GetNATType return current NAT type after a probe.
func (*MobileNode) GetPaymentGatewayOrder ¶
func (mb *MobileNode) GetPaymentGatewayOrder(req *GetPaymentOrderRequest) ([]byte, error)
GetPaymentGatewayOrder gets an order by ID.
func (*MobileNode) GetPaymentGatewayOrderInvoice ¶
func (mb *MobileNode) GetPaymentGatewayOrderInvoice(req *GetPaymentOrderRequest) ([]byte, error)
GetPaymentGatewayOrderInvoice gets the invoice for an order.
func (*MobileNode) GetProposals ¶
func (mb *MobileNode) GetProposals(req *GetProposalsRequest) ([]byte, error)
GetProposals returns service proposals from API or cache. Proposals returned as JSON byte array since go mobile does not support complex slices.
func (*MobileNode) GetProposalsByPreset ¶
func (mb *MobileNode) GetProposalsByPreset(presetID int) ([]byte, error)
GetProposalsByPreset returns service proposals by presetID.
func (*MobileNode) GetStatus ¶
func (mb *MobileNode) GetStatus() ([]byte, error)
GetStatus returns current connection state and provider info if connected to VPN.
func (*MobileNode) GetUnsettledEarnings ¶
func (mb *MobileNode) GetUnsettledEarnings(req *GetBalanceRequest) (*GetBalanceResponse, error)
GetUnsettledEarnings returns unsettled earnings.
func (*MobileNode) HealthCheck ¶
func (mb *MobileNode) HealthCheck() *HealthCheckData
HealthCheck returns node health check data.
func (*MobileNode) ImportIdentity ¶
func (mb *MobileNode) ImportIdentity(data []byte, passphrase string) (string, error)
ImportIdentity import a given identity address given data (json as string) and the current passphrase.
Identity can only be imported if it is registered.
func (*MobileNode) IsFreeRegistrationEligible ¶
func (mb *MobileNode) IsFreeRegistrationEligible(identityAddress string) (bool, error)
IsFreeRegistrationEligible returns true if free registration is possible for a given identity.
func (*MobileNode) ListConsumerSessions ¶
func (mb *MobileNode) ListConsumerSessions(filter *SessionFilter) ([]byte, error)
ListConsumerSessions list consumer sessions
func (*MobileNode) ListPaymentGatewayOrders ¶
func (mb *MobileNode) ListPaymentGatewayOrders(req *ListOrdersRequest) ([]byte, error)
ListPaymentGatewayOrders lists all payment orders.
func (*MobileNode) ListProposalFilterPresets ¶
func (mb *MobileNode) ListProposalFilterPresets() ([]byte, error)
ListProposalFilterPresets lists system and user created filter presets for proposals see ProposalFilterPreset for contract
func (*MobileNode) MigrateHermes ¶
func (mb *MobileNode) MigrateHermes(id string) error
MigrateHermes migrate from old to active Hermes
func (*MobileNode) MigrateHermesStatus ¶
func (mb *MobileNode) MigrateHermesStatus(id string) ([]byte, error)
MigrateHermesStatus migrate from old to active Hermes
func (*MobileNode) OverrideWireguardConnection ¶
func (mb *MobileNode) OverrideWireguardConnection(wgTunnelSetup WireguardTunnelSetup)
OverrideWireguardConnection overrides default wireguard connection implementation to more mobile adapted one.
func (*MobileNode) Reconnect ¶
func (mb *MobileNode) Reconnect(req *ConnectRequest) *ConnectResponse
Reconnect is deprecated, we are doing reconnect now in the connection manager. TODO remove this from mobile app and here too.
func (*MobileNode) RegisterBalanceChangeCallback ¶
func (mb *MobileNode) RegisterBalanceChangeCallback(cb BalanceChangeCallback)
RegisterBalanceChangeCallback registers callback which is called on identity balance change.
func (*MobileNode) RegisterConnectionStatusChangeCallback ¶
func (mb *MobileNode) RegisterConnectionStatusChangeCallback(cb ConnectionStatusChangeCallback)
RegisterConnectionStatusChangeCallback registers callback which is called on active connection status change.
func (*MobileNode) RegisterIdentity ¶
func (mb *MobileNode) RegisterIdentity(req *RegisterIdentityRequest) error
RegisterIdentity starts identity registration in background.
func (*MobileNode) RegisterIdentityRegistrationChangeCallback ¶
func (mb *MobileNode) RegisterIdentityRegistrationChangeCallback(cb IdentityRegistrationChangeCallback)
RegisterIdentityRegistrationChangeCallback registers callback which is called on identity registration status change.
func (*MobileNode) RegisterOrderUpdatedCallback ¶
func (mb *MobileNode) RegisterOrderUpdatedCallback(cb OrderUpdatedCallback)
RegisterOrderUpdatedCallback registers OrderStatusChanged callback.
func (*MobileNode) RegisterServiceStatusChangeCallback ¶
func (mb *MobileNode) RegisterServiceStatusChangeCallback(cb ServiceStatusChangeCallback)
RegisterServiceStatusChangeCallback registers callback which is called on active connection status change.
func (*MobileNode) RegisterStatisticsChangeCallback ¶
func (mb *MobileNode) RegisterStatisticsChangeCallback(cb StatisticsChangeCallback)
RegisterStatisticsChangeCallback registers callback which is called on active connection statistics change.
func (*MobileNode) RegistrationTokenReward ¶
func (mb *MobileNode) RegistrationTokenReward(token string) (float64, error)
RegistrationTokenReward returns the reward amount for a given token.
func (*MobileNode) ResidentCountry ¶
func (mb *MobileNode) ResidentCountry() string
ResidentCountry resident country
func (*MobileNode) SendFeedback ¶
func (mb *MobileNode) SendFeedback(req *SendFeedbackRequest) error
SendFeedback sends user feedback via feedback reported.
func (*MobileNode) SetUserConfig ¶
func (mb *MobileNode) SetUserConfig(key, value string) error
SetUserConfig sets a user values in the configuration file
func (*MobileNode) Shutdown ¶
func (mb *MobileNode) Shutdown() error
Shutdown function stops running mobile node.
func (*MobileNode) StartProvider ¶
func (mb *MobileNode) StartProvider()
StartProvider starts all provider services (provider mode)
func (*MobileNode) StopProvider ¶
func (mb *MobileNode) StopProvider()
StopProvider stops all provider services, started by StartProvider
func (*MobileNode) UpdateResidentCountry ¶
func (mb *MobileNode) UpdateResidentCountry(r *ResidentCountryUpdateRequest) error
UpdateResidentCountry updates resident country
func (*MobileNode) WaitUntilDies ¶
func (mb *MobileNode) WaitUntilDies() error
WaitUntilDies function returns when node stops.
type MobileNodeOptions ¶
type MobileNodeOptions struct { Network string KeepConnectedOnFail bool DiscoveryAddress string BrokerAddresses []string EtherClientRPCL1 []string EtherClientRPCL2 []string FeedbackURL string QualityOracleURL string IPDetectorURL string LocationDetectorURL string TransactorEndpointAddress string AffiliatorEndpointAddress string HermesEndpointAddress string Chain1ID int64 Chain2ID int64 ActiveChainID int64 PilvytisAddress string MystSCAddress string RegistrySCAddress string HermesSCAddress string ChannelImplementationSCAddress string CacheTTLSeconds int ObserverAddress string IsProvider bool TequilapiSecured bool UIFeaturesEnabled string }
MobileNodeOptions contains common mobile node options.
func DefaultNodeOptions ¶
func DefaultNodeOptions() *MobileNodeOptions
DefaultNodeOptions returns default options.
func DefaultNodeOptionsByNetwork ¶
func DefaultNodeOptionsByNetwork(network string) *MobileNodeOptions
DefaultNodeOptionsByNetwork returns default options by network.
func DefaultProviderNodeOptions ¶
func DefaultProviderNodeOptions() *MobileNodeOptions
DefaultProviderNodeOptions returns default options.
type OrderUpdatedCallback ¶
type OrderUpdatedCallback interface {
OnUpdate(payload *OrderUpdatedCallbackPayload)
}
OrderUpdatedCallback is a callback when order status changes.
type OrderUpdatedCallbackPayload ¶
type OrderUpdatedCallbackPayload struct { OrderID string Status string PayAmount string PayCurrency string }
OrderUpdatedCallbackPayload is the payload of OrderUpdatedCallback.
type PaymentOrderOptions ¶
type PaymentOrderOptions struct { Minimum float64 `json:"minimum"` Suggested []float64 `json:"suggested"` }
PaymentOrderOptions are the suggested and minimum myst amount options for a gateway.
type PaymentOrderResponse ¶
type PaymentOrderResponse struct { ID string `json:"id"` Status string `json:"status"` IdentityAddress string `json:"identity"` ChannelAddress string `json:"channel_address"` Gateway string `json:"gateway"` ReceiveMYST string `json:"receive_myst"` PayAmount string `json:"pay_amount"` PayCurrency string `json:"pay_currency"` Country string `json:"country"` Currency string `json:"currency"` ItemsSubTotal string `json:"items_sub_total"` TaxRate string `json:"tax_rate"` TaxSubTotal string `json:"tax_sub_total"` OrderTotal string `json:"order_total"` PublicGatewayData json.RawMessage `json:"public_gateway_data"` }
PaymentOrderResponse represents a payment order for mobile usage.
type ProposalChangeCallback ¶
type ProposalChangeCallback interface {
OnChange(proposal []byte)
}
ProposalChangeCallback represents proposal callback.
type ProposalFilterPreset ¶
ProposalFilterPreset represents proposal filter preset
type RegisterIdentityRequest ¶
RegisterIdentityRequest represents identity registration request.
type ResidentCountryUpdateRequest ¶
ResidentCountryUpdateRequest represents a partial typed config (as appose to map[string]interface blob)
type SendFeedbackRequest ¶
SendFeedbackRequest represents user feedback request.
type ServiceStatusChangeCallback ¶
ServiceStatusChangeCallback represents status callback.
type ServicesState ¶
ServicesState - state of service
type SessionDTO ¶
type SessionDTO struct { ID string `json:"id"` Direction string `json:"direction"` ConsumerID string `json:"consumer_id"` HermesID string `json:"hermes_id"` ProviderID string `json:"provider_id"` ServiceType string `json:"service_type"` ConsumerCountry string `json:"consumer_country"` ProviderCountry string `json:"provider_country"` CreatedAt string `json:"created_at"` Duration uint64 `json:"duration"` BytesReceived uint64 `json:"bytes_received"` BytesSent uint64 `json:"bytes_sent"` Tokens *big.Int `json:"tokens"` Status string `json:"status"` IPType string `json:"ip_type"` }
SessionDTO mobile session dto
type SessionFilter ¶
SessionFilter allows to filter by time slice
* arguments will be attempted to be parsed by time.RFC3339 * * @see https://golang.org/pkg/time/ * * @param StartedFrom - e.g. "2006-01-02T15:04:05Z" or null if undetermined * @param StartedTo - e.g. "2006-04-02T15:04:05Z" or null if undetermined
type SessionStorage ¶
SessionStorage provides access to session history
type StatisticsChangeCallback ¶
type StatisticsChangeCallback interface {
OnChange(duration int64, bytesReceived int64, bytesSent int64, tokensSpent float64)
}
StatisticsChangeCallback represents statistics callback.
type WireguardTunnelSetup ¶
type WireguardTunnelSetup interface { NewTunnel() AddTunnelAddress(ip string, prefixLen int) AddRoute(route string, prefixLen int) AddDNS(ip string) SetBlocking(blocking bool) Establish() (int, error) SetMTU(mtu int) Protect(socket int) error SetSessionName(session string) }
WireguardTunnelSetup exposes api for caller to implement external tunnel setup