Documentation
¶
Overview ¶
api is package containg the ApiClientWrapper wich is used as wgrest client.
See https://github.com/suquant/wgrest for more information.
Index ¶
- type ApiClientWrapper
- func (w ApiClientWrapper) CreateDevice() (*forestvpn_api.Device, error)
- func (w ApiClientWrapper) DeleteDevice(id string) error
- func (w ApiClientWrapper) GetBillingFeatures() ([]forestvpn_api.BillingFeature, error)
- func (w ApiClientWrapper) GetDevice(id string) (*forestvpn_api.Device, error)
- func (w ApiClientWrapper) GetLocations() ([]forestvpn_api.Location, error)
- func (w ApiClientWrapper) UpdateDevice(deviceID string, locationID string) (*forestvpn_api.Device, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiClientWrapper ¶
type ApiClientWrapper struct { APIClient *forestvpn_api.APIClient AccessToken string }
ApiClientWrapper is a structure that wraps forestvpn_api.APIClient to extend it.
See https://github.com/forestvpn/api-client-go for more information.
func GetApiClient ¶
func GetApiClient(accessToken string, apiHost string) ApiClientWrapper
GetApiClient is a factory function that returns the ApiClientWrapper structure. It configures and wraps an instance of forestvpn_api.APIClient.
See https://github.com/forestvpn/api-client-go for more information.
func (ApiClientWrapper) CreateDevice ¶
func (w ApiClientWrapper) CreateDevice() (*forestvpn_api.Device, error)
CreateDevice sends a POST request to create a new device on the back-end after the user successfully logged in.
See https://github.com/forestvpn/api-client-go/blob/main/docs/DeviceApi.md#createdevice for more information.
func (ApiClientWrapper) DeleteDevice ¶
func (w ApiClientWrapper) DeleteDevice(id string) error
func (ApiClientWrapper) GetBillingFeatures ¶
func (w ApiClientWrapper) GetBillingFeatures() ([]forestvpn_api.BillingFeature, error)
GetBillingFeatures is a method for getting locations available to the user.
See https://github.com/forestvpn/api-client-go/blob/main/docs/BillingApi.md#listbillingfeatures for more information.
func (ApiClientWrapper) GetDevice ¶
func (w ApiClientWrapper) GetDevice(id string) (*forestvpn_api.Device, error)
GetDevice is a method to get the device created on the registraton of the user.
See https://github.com/forestvpn/api-client-go/blob/main/docs/DeviceApi.md#getdevice for more information.
func (ApiClientWrapper) GetLocations ¶
func (w ApiClientWrapper) GetLocations() ([]forestvpn_api.Location, error)
GetLocations is a method for getting all the locations available at back-end.
See https://github.com/forestvpn/api-client-go/blob/main/docs/GeoApi.md#listlocations for more information.
func (ApiClientWrapper) UpdateDevice ¶
func (w ApiClientWrapper) UpdateDevice(deviceID string, locationID string) (*forestvpn_api.Device, error)
UpdateDevice updates an existing device for the user on the back-end.
See https://github.com/forestvpn/api-client-go/blob/main/docs/DeviceApi.md#updatedevice for more information.