Documentation ¶
Index ¶
- type AgentConnection
- type ConnectionDetails
- type Consts
- type ErrorCode
- type ErrorMessage
- type ErrorType
- type Features
- type GetStatusMessage
- type MessageSocket
- type NativeClient
- type Reason
- type State
- type StatusMessage
- type StringArray
- type StringToValueMap
- func (feat *StringToValueMap) GetBool(name string) bool
- func (feat *StringToValueMap) GetCount() int
- func (feat *StringToValueMap) GetInt(name string) int64
- func (feat *StringToValueMap) GetIntOrDefault(name string, defautVal int64) int64
- func (feat *StringToValueMap) GetKeys() *StringArray
- func (feat *StringToValueMap) GetMap(name string) *StringToValueMap
- func (feat *StringToValueMap) GetString(name string) string
- func (feat *StringToValueMap) GetStringOrDefault(name string, defaultVal string) string
- func (feat *StringToValueMap) HasKey(name string) bool
- func (feat *StringToValueMap) MarshalJSON() ([]byte, error)
- func (feat *StringToValueMap) Remove(key string)
- func (feat *StringToValueMap) SetBool(name string, value bool)
- func (feat *StringToValueMap) SetInt(name string, value int64)
- func (feat *StringToValueMap) SetString(name string, value string)
- func (feat *StringToValueMap) UnmarshalJSON(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentConnection ¶
type AgentConnection struct { State State Status *StatusMessage // contains filtered or unexported fields }
func NewAgentConnection ¶
func NewAgentConnection( clientCertPEM, clientKeyPEM, serverCAsPEM string, host string, certServerName string, client NativeClient, features *Features, connectivity bool, ) (*AgentConnection, error)
func (*AgentConnection) Close ¶
func (conn *AgentConnection) Close()
func (*AgentConnection) SendGetStatus ¶
func (conn *AgentConnection) SendGetStatus(withStatistics bool)
func (*AgentConnection) SetConnectivity ¶
func (conn *AgentConnection) SetConnectivity(available bool)
func (*AgentConnection) SetFeatures ¶
func (conn *AgentConnection) SetFeatures(features *Features)
type ConnectionDetails ¶
type Consts ¶
type Consts struct { // States StateConnecting State StateConnected State StateSoftJailed State StateHardJailed State StateConnectionError State StateServerUnreachable State StateWaitingForNetwork State StateServerCertificateError State StateClientCertificateExpiredError State StateClientCertificateUnknownCA State StateDisconnected State // Error codes ErrorCodeUnknown ErrorCode ErrorCodeGuestSession ErrorCode ErrorCodeRestrictedServer ErrorCode ErrorCodeBadCertSignature ErrorCode ErrorCodeCertNotProvided ErrorCode ErrorCodeCertificateExpired ErrorCode ErrorCodeCertificateRevoked ErrorCode ErrorCodeMaxSessionsUnknown ErrorCode ErrorCodeMaxSessionsFree ErrorCode ErrorCodeMaxSessionsBasic ErrorCode ErrorCodeMaxSessionsPlus ErrorCode ErrorCodeMaxSessionsVisionary ErrorCode ErrorCodeMaxSessionsPro ErrorCode ErrorCodeKeyUsedMultipleTimes ErrorCode ErrorCodeServerError ErrorCode ErrorCodePolicyViolationLowPlan ErrorCode ErrorCodePolicyViolationDelinquent ErrorCode ErrorCodeUserTorrentNotAllowed ErrorCode ErrorCodeUserBadBehavior ErrorCode LabelPartner string FeatureBouncing string // Stats StatsNetshieldLevelKey string StatsMalwareKey string StatsAdsKey string StatsTrackerKey string StatsSavedBytesKey string }
type ErrorMessage ¶
type Features ¶
type Features struct {
StringToValueMap
}
func NewFeatures ¶
func NewFeatures() *Features
type GetStatusMessage ¶
type GetStatusMessage struct {
FeaturesStatistics bool `json:"features-statistics"`
}
type MessageSocket ¶
type MessageSocket struct {
// contains filtered or unexported fields
}
type NativeClient ¶
type NativeClient interface { Log(text string) OnState(state State) OnError(code int, description string) OnStatusUpdate(status *StatusMessage) OnTlsSessionStarted() OnTlsSessionEnded() }
type StatusMessage ¶
type StatusMessage struct { State string `json:"state"` Features *Features `json:"features"` Reason *Reason `json:"reason"` SwitchTo string `json:"please-switch-to"` ConnectionDetails *ConnectionDetails `json:"connection-details"` FeaturesStatistics *StringToValueMap `json:"features-statistics"` }
type StringArray ¶
type StringArray struct {
// contains filtered or unexported fields
}
StringArray - helper struct introduced because gomobile doesn't support array return types
func (*StringArray) Get ¶
func (arr *StringArray) Get(i int) string
func (*StringArray) GetCount ¶
func (arr *StringArray) GetCount() int
type StringToValueMap ¶
type StringToValueMap struct {
// contains filtered or unexported fields
}
func (*StringToValueMap) GetBool ¶
func (feat *StringToValueMap) GetBool(name string) bool
func (*StringToValueMap) GetCount ¶
func (feat *StringToValueMap) GetCount() int
func (*StringToValueMap) GetInt ¶
func (feat *StringToValueMap) GetInt(name string) int64
func (*StringToValueMap) GetIntOrDefault ¶
func (feat *StringToValueMap) GetIntOrDefault(name string, defautVal int64) int64
func (*StringToValueMap) GetKeys ¶
func (feat *StringToValueMap) GetKeys() *StringArray
func (*StringToValueMap) GetMap ¶
func (feat *StringToValueMap) GetMap(name string) *StringToValueMap
func (*StringToValueMap) GetString ¶
func (feat *StringToValueMap) GetString(name string) string
func (*StringToValueMap) GetStringOrDefault ¶
func (feat *StringToValueMap) GetStringOrDefault(name string, defaultVal string) string
func (*StringToValueMap) HasKey ¶
func (feat *StringToValueMap) HasKey(name string) bool
func (*StringToValueMap) MarshalJSON ¶
func (feat *StringToValueMap) MarshalJSON() ([]byte, error)
func (*StringToValueMap) Remove ¶
func (feat *StringToValueMap) Remove(key string)
func (*StringToValueMap) SetBool ¶
func (feat *StringToValueMap) SetBool(name string, value bool)
func (*StringToValueMap) SetInt ¶
func (feat *StringToValueMap) SetInt(name string, value int64)
func (*StringToValueMap) SetString ¶
func (feat *StringToValueMap) SetString(name string, value string)
func (*StringToValueMap) UnmarshalJSON ¶
func (feat *StringToValueMap) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.