rixcloud

package
v0.0.0-...-96cb566 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2018 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	BaseURL    = "https://api.rixcloud.io"
	APIVersion = "/v1/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

APIError the gerenral error

func (APIError) Error

func (e APIError) Error() string

type ActivedService

type ActivedService struct {
	ServiceID    int    `json:"serviceid,omitempty"`
	Name         string `json:"name,omitempty"`
	GroupName    string `json:"groupname,omitempty"`
	GroupID      int    `json:"groupid,omitempty"`
	NextDueDate  string `json:"nextduedate,omitempty"`
	BillingCycle string `json:"billingcycle,omitempty"`
}

ActivedService ...

type Client

type Client struct {

	// profile service
	Profiles *ProfileService
	// contains filtered or unexported fields
}

Client is a client for making RixCloud API requests.

func NewClient

func NewClient(httpClient *http.Client, username string, password string) *Client

NewClient ...

type DeactivedServie

type DeactivedServie struct {
	ServiceID int    `json:"serviceid,omitempty"`
	Status    string `json:"status,omitempty"`
}

DeactivedServie ...

type Profile

type Profile struct {
	UserID int `json:"userid,omitempty"`
}

Profile the user profile

type ProfileService

type ProfileService struct {
	// contains filtered or unexported fields
}

ProfileService provides a method for credential verification.

func NewProfileService

func NewProfileService(sling *sling.Sling) *ProfileService

NewProfileService returns a new AccountService.

func (*ProfileService) GetServiceOverview

func (s *ProfileService) GetServiceOverview() (*ServiceOverview, *http.Response, error)

GetServiceOverview ...

func (*ProfileService) GetTrafficData

func (s *ProfileService) GetTrafficData(serviceid string) (*Traffic, *http.Response, error)

GetTrafficData ...

func (*ProfileService) VerifyCredentials

func (s *ProfileService) VerifyCredentials() (*Profile, *http.Response, error)

VerifyCredentials ...

type ServiceAPIResponse

type ServiceAPIResponse struct {
	Data *ServiceOverview `json:"data,omitempty"`
}

ServiceAPIResponse ...

type ServiceNode

type ServiceNode struct {
	Name      string `json:"name,omitempty"`
	IP        string `json:"ip,omitempty"`
	Provider  string `json:"provider,omitempty"`
	Bandwidth string `json:"bandwidth,omitempty"`
	Feature   string `json:"feature,omitempty"`
	ISP       string `json:"isp,omitempty"`
	Rate      string `json:"rate,omitempty"`
}

ServiceNode the node which service provide

type ServiceOverview

type ServiceOverview struct {
	ActiveCount  int               `json:"activecount,omitempty"`
	TotalService int               `json:"totalserveice,omitempty"`
	Actived      []ActivedService  `json:"actived,omitempty"`
	Deactived    []DeactivedServie `json:"deactived,omitempty"`
}

ServiceOverview ...

type Traffic

type Traffic struct {
	Upload   int64 `json:"upload,omitempty"`
	Download int64 `json:"download,omitempty"`
	Total    int64 `json:"total,omitempty"`
}

Traffic data

type TrafficAPIResponse

type TrafficAPIResponse struct {
	Data *Traffic `json:"data,omitempty"`
}

TrafficAPIResponse ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL