Documentation ¶
Index ¶
- type CreatePaymentOption
- type CreatePaymentOptions
- type CreatePaymentResult
- type DDoSAttack
- type GetUDPFilterResult
- type GetVPSStateResult
- type InspectPaymentResult
- type ListDDoSAttacksResult
- type ListPaymentsOption
- type ListPaymentsOptions
- type ListPaymentsResult
- type ListPaymentsResultItem
- type ListServicesResult
- type LvlClient
- func (lc LvlClient) AddUDPFilterException(vpsId string, exception *UDPFilterException) error
- func (lc LvlClient) CreatePayment(amount string, opts ...CreatePaymentOption) (*CreatePaymentResult, error)
- func (lc LvlClient) GetProxmoUser(vpsId string) (*ProxmoUser, error)
- func (lc LvlClient) GetUDPFilter(vpsId string) (*GetUDPFilterResult, error)
- func (lc LvlClient) GetVPSState(vpsId string) (*GetVPSStateResult, error)
- func (lc LvlClient) InspectPayment(paymentId string) (*InspectPaymentResult, error)
- func (lc LvlClient) ListDDoSAttacks(vpsId string) (*ListDDoSAttacksResult, error)
- func (lc LvlClient) ListPayments(opts ...ListPaymentsOption) (*ListPaymentsResult, error)
- func (lc LvlClient) ListServices() (*ListServicesResult, error)
- func (lc LvlClient) ListUDPFilterExceptions(vpsId string) ([]UDPFilterException, error)
- func (lc LvlClient) RemoveUDPFilterException(vpsId string, exceptionId string) error
- func (lc LvlClient) SetUDPFiltering(vpsId string, filteringEnabled bool) (*SetUDPFilteringResult, error)
- func (lc LvlClient) StartVPS(vpsId string) error
- func (lc LvlClient) StopVPS(vpsId string) error
- func (lc LvlClient) WalletBalance() (*WalletBalanceResult, error)
- type LvlClientOption
- type ProxmoUser
- type Service
- type SetUDPFilteringOptions
- type SetUDPFilteringResult
- type UDPFilterException
- type UDPFilterExceptionPorts
- type WalletBalanceResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreatePaymentOption ¶
type CreatePaymentOption func(*CreatePaymentOptions)
CreatePaymentOption represents a functional option for CreatePayment func.
func WithRedirect ¶
func WithRedirect(url string) CreatePaymentOption
Set url to which user should be redirected after completing a payment.
func WithWebhook ¶
func WithWebhook(url string) CreatePaymentOption
WithWebhook sets webhook url to which POST request will be send after completing a payment.
type CreatePaymentOptions ¶
type CreatePaymentOptions struct { Amount string `json:"amount"` RedirectUrl string `json:"redirectUrl"` WebhookUrl string `json:"webhookUrl"` }
CreatePaymentOptions represents available options for CreatePayment func.
type CreatePaymentResult ¶
CreatePaymentResult represents result of CreatePayment func.
type DDoSAttack ¶
type DDoSAttack struct { Id int `json:"id"` Ip string `json:"ip"` StartedAt int `json:"startedAt"` EndedAt int `json:"endedAt"` }
DDoSAttack represents single DDoS Attack.
type GetUDPFilterResult ¶
type GetUDPFilterResult struct { FilteringEnabled bool `json:"filteringEnabled"` State string `json:"state"` }
GetUDPFilterResult represents result of GetUDPFilter func.
type GetVPSStateResult ¶
GetVPSStateResult represents result of GetVPSState.
type InspectPaymentResult ¶
type InspectPaymentResult struct { AmountInt int `json:"amountInt"` AmountStr string `json:"amuntStr"` AmountWithFeeInt int `json:"amountWithFeeInt"` AmountWithFeeStr string `json:"amountWithFeeStr"` Payed bool `json:"payed"` }
InspectPaymentResult represents result of InspectPayment func.
type ListDDoSAttacksResult ¶
type ListDDoSAttacksResult struct { Count int `json:"count"` Items []DDoSAttack `json:"items"` }
ListDDoSAttacksResult represents result of ListDDoSAttacks func.
type ListPaymentsOption ¶
type ListPaymentsOption func(*ListPaymentsOptions)
ListPaymentsOption represents functional option for a ListPayments func.
func WithAfterId ¶
func WithAfterId(afterId int) ListPaymentsOption
WithAfterId allows to set payment id after which payments should be returned.
func WithBeforeId ¶
func WithBeforeId(beforeId int) ListPaymentsOption
WithBeforeId allows to set payment id before which payments should be returned.
func WithLimit ¶
func WithLimit(limit int) ListPaymentsOption
WithLimit allows to set max payments count per page.
type ListPaymentsOptions ¶
ListPaymentsOptions represents a map storing optional query parameters for ListPayments func.
type ListPaymentsResult ¶
type ListPaymentsResult struct { Count int `json:"count"` Items []ListPaymentsResultItem `json:"items"` }
ListPaymentsResult represents result of ListPayments func.
type ListPaymentsResultItem ¶
type ListPaymentsResultItem struct { Amount string `json:"amount"` CreatedAt string `json:"createdAt"` Description string `json:"description"` Id int `json:"id"` MethodId int `json:"methodId"` ServiceId int `json:"serviceId"` }
ListPaymentsResultItem represents single item from ListPayments func.
type ListServicesResult ¶
type ListServicesResult struct {
Services []Service
}
ListServices represents result of ListServices func.
type LvlClient ¶
LvlClient describes properties stored by the client.
func NewLvlClient ¶
func NewLvlClient(apiKey string, httpClient *http.Client, opts ...LvlClientOption) *LvlClient
NewLvlClient creates new lvlup api client.
func (LvlClient) AddUDPFilterException ¶
func (lc LvlClient) AddUDPFilterException(vpsId string, exception *UDPFilterException) error
AddUDPFilterException allows to add exception for UDP filter.
func (LvlClient) CreatePayment ¶
func (lc LvlClient) CreatePayment(amount string, opts ...CreatePaymentOption) (*CreatePaymentResult, error)
CreatePayment allows to create a new payment url. It returns result of a request and any errors encountered.
func (LvlClient) GetProxmoUser ¶
func (lc LvlClient) GetProxmoUser(vpsId string) (*ProxmoUser, error)
GetProxmoUser allows to create new proxmo user, or reset password if already exists.
func (LvlClient) GetUDPFilter ¶
func (lc LvlClient) GetUDPFilter(vpsId string) (*GetUDPFilterResult, error)
GetUDPFilter allows to check UDP filtering status for specified VPS.
func (LvlClient) GetVPSState ¶
func (lc LvlClient) GetVPSState(vpsId string) (*GetVPSStateResult, error)
GetVPSState allows to get specified VPS state.
func (LvlClient) InspectPayment ¶
func (lc LvlClient) InspectPayment(paymentId string) (*InspectPaymentResult, error)
InspectPayment allows to inspect a payment. It returns request result and any errors encountered.
func (LvlClient) ListDDoSAttacks ¶
func (lc LvlClient) ListDDoSAttacks(vpsId string) (*ListDDoSAttacksResult, error)
ListDDoSAttacks allows to access list of DDoS attacks for specific VPS.
func (LvlClient) ListPayments ¶
func (lc LvlClient) ListPayments(opts ...ListPaymentsOption) (*ListPaymentsResult, error)
ListPayments allows to list client's payments. It returns request result and eny errors encountered.
func (LvlClient) ListServices ¶
func (lc LvlClient) ListServices() (*ListServicesResult, error)
ListServices allows to list all services like VPS or domains. It returns request result or any errors encountered.
func (LvlClient) ListUDPFilterExceptions ¶
func (lc LvlClient) ListUDPFilterExceptions(vpsId string) ([]UDPFilterException, error)
ListUDPFilterExceptions allows to list all exceptions for UDP filter.
func (LvlClient) RemoveUDPFilterException ¶
RemoveUDPFilterException allows to remove exception for UDP filter.
func (LvlClient) SetUDPFiltering ¶
func (lc LvlClient) SetUDPFiltering(vpsId string, filteringEnabled bool) (*SetUDPFilteringResult, error)
SetUDPFiltering allows to switch UDP filtering status for specified VPS on and off.
func (LvlClient) WalletBalance ¶
func (lc LvlClient) WalletBalance() (*WalletBalanceResult, error)
WalletBalance allows to get current wallet balance. It returns request result and any errors encountered.
type LvlClientOption ¶
type LvlClientOption func(*LvlClient)
LvlClientOption describes functional option for the client.
func WithSandboxMode ¶
func WithSandboxMode() LvlClientOption
WithSandboxMode enables sandbox mode for the LvlClient.
type ProxmoUser ¶
type ProxmoUser struct { Password string `json:"password"` Url string `json:"url"` Username string `json:"username"` }
ProxmoUser represents proxmo user.
type Service ¶
type Service struct { Id int `json:"id"` PlanName string `json:"planName"` Active bool `json:"active"` CreatedAt string `json:"createdAt"` PayedTo string `json:"payedTo"` Ip string `json:"ip"` Name string `json:"name"` NodeId int `json:"nodeId"` ServiceId int `json:"serviceId"` }
Service represents single service from ListServices func result.
type SetUDPFilteringOptions ¶
type SetUDPFilteringOptions struct {
FilteringEnabled bool `json:"filteringEnabled"`
}
SetUDPFilteringOptions represents available options for SetUDPFiltering func.
type SetUDPFilteringResult ¶
type SetUDPFilteringResult struct { FilteringEnabled bool `json:"filteringEnabled"` State string `json:"state"` }
SetUDPFilteringResult represents result of SetUDPFiltering func.
type UDPFilterException ¶
type UDPFilterException struct { Id int `json:"id"` Ports []UDPFilterExceptionPorts `json:"ports"` Protocol string `json:"protocol"` State string `json:"state"` }
UDPFilterWhitelistException represents single exception.
type UDPFilterExceptionPorts ¶
UDPFilterExceptionPorts represents options for UDP filter exception ports.
type WalletBalanceResult ¶
type WalletBalanceResult struct { BalancePlnFormatted string `json:"balancePlnFormatted"` BalancePlnInt int `json:"balancePlnInt"` }
WalletBalanceResult represents result of WalletBalance request.