Documentation
¶
Index ¶
- func ExportExchangePayload() string
- func GetBuildInfo() string
- func GetPacketTunnelMTU() int
- func HomepageFilePath(rootDataDirectoryPath string) string
- func ImportExchangePayload(payload string) bool
- func NetworkChanged()
- func NoticeUserLog(message string)
- func NoticesFilePath(rootDataDirectoryPath string) string
- func OldNoticesFilePath(rootDataDirectoryPath string) string
- func ReconnectTunnel()
- func SetDynamicConfig(newSponsorID, newAuthorizationsList string)
- func Start(configJson string, embeddedServerEntryList string, ...) error
- func StartSendFeedback(configJson, diagnosticsJson, uploadPath string, ...) error
- func Stop()
- func StopSendFeedback()
- func UpgradeDownloadFilePath(rootDataDirectoryPath string) string
- func WriteRuntimeProfiles(outputDirectory string, ...)
- type VaipnProvider
- type VaipnProviderFeedbackHandler
- type VaipnProviderNetwork
- type VaipnProviderNoticeHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExportExchangePayload ¶
func ExportExchangePayload() string
ExportExchangePayload creates a payload for client-to-client server connection info exchange.
ExportExchangePayload will succeed only when Vaipn is running, between Start and Stop.
The return value is a payload that may be exchanged with another client; when "", the export failed and a diagnostic has been logged.
func GetPacketTunnelMTU ¶
func GetPacketTunnelMTU() int
func HomepageFilePath ¶
HomepageFilePath returns the path where homepage files will be paved.
rootDataDirectoryPath is the configured data root directory.
Note: homepage files will only be paved if UseNoticeFiles is set in the config passed to Start().
func ImportExchangePayload ¶
ImportExchangePayload imports a payload generated by ExportExchangePayload.
If an import occurs when Vaipn is working to establsh a tunnel, the newly imported server entry is prioritized.
The return value indicates a successful import. If the import failed, a a diagnostic notice has been logged.
func NetworkChanged ¶
func NetworkChanged()
NetworkChanged initiates a reset of all open network connections, including a tunnel reconnect.
func NoticeUserLog ¶
func NoticeUserLog(message string)
func NoticesFilePath ¶
NoticesFilePath returns the path where the notices file will be paved.
rootDataDirectoryPath is the configured data root directory.
Note: notices will only be paved if UseNoticeFiles is set in the config passed to Start().
func OldNoticesFilePath ¶
OldNoticesFilePath returns the path where the notices file is moved to when file rotation occurs.
rootDataDirectoryPath is the configured data root directory.
Note: notices will only be paved if UseNoticeFiles is set in the config passed to Start().
func ReconnectTunnel ¶
func ReconnectTunnel()
ReconnectTunnel initiates a reconnect of the current tunnel, if one is running.
func SetDynamicConfig ¶
func SetDynamicConfig(newSponsorID, newAuthorizationsList string)
SetDynamicConfig overrides the sponsor ID and authorizations fields set in the config passed to Start. SetDynamicConfig has no effect if no Controller is started.
The input newAuthorizationsList is a space-delimited list of base64 authorizations. This is a workaround for gobind type limitations.
func StartSendFeedback ¶
func StartSendFeedback( configJson, diagnosticsJson, uploadPath string, feedbackHandler VaipnProviderFeedbackHandler, networkInfoProvider VaipnProviderNetwork, noticeHandler VaipnProviderNoticeHandler, useIPv6Synthesizer bool, useHasIPv6RouteGetter bool) error
StartSendFeedback encrypts the provided diagnostics and then attempts to upload the encrypted diagnostics to one of the feedback upload locations supplied by the provided config or tactics.
Returns immediately after starting the operation in a goroutine. The operation has completed when SendFeedbackCompleted(error) is called on the provided VaipnProviderFeedbackHandler; if error is non-nil, then the operation failed.
Only one active upload is supported at a time. An ongoing upload will be cancelled if this function is called again before it completes.
Warnings:
- Should not be used with Start concurrently in the same process
- An ongoing feedback upload started with StartSendFeedback should be stopped with StopSendFeedback before the process exists. This ensures that any underlying resources are cleaned up; failing to do so may result in data store corruption or other undefined behavior.
- Start and StartSendFeedback both make an attempt to migrate persistent files from legacy locations in a one-time operation. If these functions are called in parallel, then there is a chance that the migration attempts could execute at the same time and result in non-fatal errors in one, or both, of the migration operations.
- Calling StartSendFeedback or StopSendFeedback on the same call stack that the VaipnProviderFeedbackHandler.SendFeedbackCompleted() callback is delivered on can cause a deadlock. I.E. the callback code must return so the wait group can complete and the lock acquired in StopSendFeedback can be released.
func StopSendFeedback ¶
func StopSendFeedback()
StopSendFeedback interrupts an in-progress feedback upload operation started with `StartSendFeedback`.
Warning: should not be used with Start concurrently in the same process.
func UpgradeDownloadFilePath ¶
UpgradeDownloadFilePath returns the path where the downloaded upgrade file will be paved.
rootDataDirectoryPath is the configured data root directory.
Note: upgrades will only be paved if UpgradeDownloadURLs is set in the config passed to Start() and there are upgrades available.
func WriteRuntimeProfiles ¶
func WriteRuntimeProfiles(outputDirectory string, cpuSampleDurationSeconds, blockSampleDurationSeconds int)
WriteRuntimeProfiles writes Go runtime profile information to a set of files in the specified output directory. See common.WriteRuntimeProfiles for more details.
If called before Start, log notices will emit to stderr.
Types ¶
type VaipnProvider ¶
type VaipnProvider interface { VaipnProviderNoticeHandler VaipnProviderNetwork BindToDevice(fileDescriptor int) (string, error) // GetDNSServersAsString must return a comma-delimited list of DNS server // addresses. A single string return value is used since gobind does not // support string slice types. GetDNSServersAsString() string }
type VaipnProviderFeedbackHandler ¶
type VaipnProviderFeedbackHandler interface {
SendFeedbackCompleted(err error)
}
type VaipnProviderNetwork ¶
type VaipnProviderNoticeHandler ¶
type VaipnProviderNoticeHandler interface {
Notice(noticeJSON string)
}