client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseReqeust

type BaseReqeust struct {
	APIKey string `json:"-"`
	Token  string `json:"-"`
}

type Client

type Client interface {
	Login(request LoginRequest) (*LoginResponse, error)
	ListDevices(request ListDevicesRequest) (*ListDevicesResponse, error)
	Connect(ConnectRequest) (*ConnectResponse, error)
}

func NewClient

func NewClient(config *viper.Viper, httpclient *http.Client, logger *log.Logger) Client

type ConnectRequest

type ConnectRequest struct {
	BaseReqeust
	DeviceAddress string `json:"deviceaddress"`
	HostIP        string `json:"hostip"`
	Wait          string `json:"wait"`
}

type ConnectResponse

type ConnectResponse struct {
	Status     string         `json:"status"`
	Connection ConnectionInfo `json:"connection"`
}

type ConnectionInfo

type ConnectionInfo struct {
	DeviceAddress       string `json:"deviceaddress"`
	ExpirationInSeconds string `json:"expirationsec"`
	ImageIntervalMS     string `json"imageintervalms"`
	Proxy               string `json:"proxy"`
	RequestedAt         string `json:"requested"`
}

type DeviceEntry

type DeviceEntry struct {
	Address      string `json:"deviceaddress"`
	Alias        string `json:"devicealias"`
	Username     string `json:"deviceusername"`
	Type         string `json:"devicetype"`
	LastIP       string `json:"devicelastip"`
	ServiceTitle string `json:"servicetitle"`
	WebEnabled   string `json:"webenabled"`
	//WebURI string `json:"weburi"`
	LocalURI string `json:"localuri"`
}

type ListDevicesRequest

type ListDevicesRequest struct {
	BaseReqeust
}

type ListDevicesResponse

type ListDevicesResponse struct {
	Status  string         `json:"status"`
	Devices []*DeviceEntry `json:"devices"`
}

type LoginRequest

type LoginRequest struct {
	APIKey   string `json:"-"`
	Username string `json:"username"`
	Password string `json:"password"`
}

type LoginResponse

type LoginResponse struct {
	Status               string `json:"status"`
	Token                string `json:"token"`
	Email                string `json:"email"`
	GUID                 string `json:"guid"`
	ServiceToken         string `json:"service_token"`
	ServiceLevel         string `json:"service_level"`
	StoragePlan          string `json:"storage_plan"`
	SecondaryAuth        string `json:"secondary_auth"`
	APIKey               string `json:"apikey"`
	AuthToken            string `json:"auth_token"`
	AuthExpiration       int    `json:"auth_expiration"`
	ServiceAuthhash      string `json:"service_authhash"`
	DeveloperPlan        string `json:"developer_plan"`
	PortalPlan           string `json:"portal_plan"`
	PortalPlanExpiration string `json:"portal_plan_expires"`
	ServiceFeatures      string `json:"service_features"`
}

Jump to

Keyboard shortcuts

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