Documentation
¶
Index ¶
- Variables
- func BuyPremiumDialog() error
- func HandleFirebaseAuthResponse(response *resty.Response) error
- func HandleFirebaseSignInResponse(response *resty.Response) error
- func Init() error
- func IsAuthenticated() bool
- func IsDeviceCreated() bool
- func IsRefreshTokenExists() bool
- func JsonDump(data []byte, filepath string) error
- func JsonLoad(filepath string) (map[string]string, error)
- func LoadAccessToken() (string, error)
- func LoadDeviceID() (string, error)
- func LoadRefreshToken() (string, error)
- type AuthClient
- type EmailField
- type Info
- type InfoForm
- type LocationWrapper
- type PasswordConfirmationField
- type PasswordField
- type SignInForm
- type SignUpForm
Constants ¶
This section is empty.
Variables ¶
View Source
var AppDir = home + "/.forestvpn/"
View Source
var Client = resty.New()
View Source
var DeviceFile = AppDir + "device.json"
var DeviceDir = AppDir + "device/"
View Source
var FirebaseAuthFile = AppDir + "firebase.json"
var AuthDir = AppDir + "auth/"
View Source
var SessionFile = AppDir + "session.json"
View Source
var WireguardConfig = AppDir + "fvpn0.conf"
var WireguardDir = AppDir + "wireguard/"
Functions ¶
func BuyPremiumDialog ¶
func BuyPremiumDialog() error
func HandleFirebaseAuthResponse ¶
func HandleFirebaseAuthResponse(response *resty.Response) error
func HandleFirebaseSignInResponse ¶
func HandleFirebaseSignInResponse(response *resty.Response) error
func IsAuthenticated ¶
func IsAuthenticated() bool
func IsDeviceCreated ¶
func IsDeviceCreated() bool
func IsRefreshTokenExists ¶
func IsRefreshTokenExists() bool
func LoadAccessToken ¶
func LoadDeviceID ¶
func LoadRefreshToken ¶
Types ¶
type AuthClient ¶
type AuthClient struct {
ApiKey string
}
func (AuthClient) ExchangeRefreshForIdToken ¶
func (c AuthClient) ExchangeRefreshForIdToken() (*resty.Response, error)
func (AuthClient) GetAccessToken ¶
func (c AuthClient) GetAccessToken() (*resty.Response, error)
func (AuthClient) SignIn ¶
func (c AuthClient) SignIn(form SignInForm) (*resty.Response, error)
func (AuthClient) SignUp ¶
func (c AuthClient) SignUp(form SignUpForm) (*resty.Response, error)
type EmailField ¶
type EmailField struct {
Value string
}
func GetEmailField ¶
func GetEmailField(email string) (EmailField, error)
func (EmailField) Validate ¶
func (f EmailField) Validate() error
type LocationWrapper ¶
type LocationWrapper struct { Location forestvpn_api.Location Type string }
type PasswordConfirmationField ¶
type PasswordConfirmationField struct {
Value []byte
}
Password confirmation is used in the *forest.auth.forms.SignUpForm
type PasswordField ¶
type PasswordField struct {
Value []byte
}
func (PasswordField) Validate ¶
func (p PasswordField) Validate() error
type SignInForm ¶
type SignInForm struct { EmailField PasswordField }
func GetSignInForm ¶
func GetSignInForm(email string, password []byte) (SignInForm, error)
Prompts user and fills the *forest.auth.forms.SignInForm with *forest.auth.forms.fields.EmailField and *forest.auth.forms.fields.PasswordField
type SignUpForm ¶
type SignUpForm struct { SignInForm PasswordConfirmationField }
func (SignUpForm) ValidatePasswordConfirmation ¶
func (s SignUpForm) ValidatePasswordConfirmation() error
Compares *forest.auth.forms.SignUpForm.SignInForm.PasswordField and *forest.auth.forms.SignUpForm.PasswordConfirmationField
Click to show internal directories.
Click to hide internal directories.