models

package
v0.0.0-...-d72c05e Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CpuInfo

type CpuInfo struct {
	Cores    int    `json:"cores"`
	Hardware string `json:"hardware"`
}

type DeviceInfo

type DeviceInfo struct {
	Udid                   string                `json:"udid,omitempty"`       // Unique device identifier
	PropertyId             string                `json:"propertyId,omitempty"` // For device managerment, eg: HIH-PHO-1122
	Version                string                `json:"version,omitempty"`    // ro.build.version.release
	Serial                 string                `json:"serial,omitempty"`     // ro.serialno
	Brand                  string                `json:"brand,omitempty"`      // ro.product.brand
	Model                  string                `json:"model,omitempty"`      // ro.product.model
	HWAddr                 string                `json:"hwaddr,omitempty"`     // persist.sys.wifi.mac
	Notes                  string                `json:"notes,omitempty"`      // device notes
	IP                     string                `json:"ip,omitempty"`
	Port                   int                   `json:"port,omitempty"`
	ReverseProxyAddr       string                `json:"reverseProxyAddr,omitempty"`
	ReverseProxyServerAddr string                `json:"reverseProxyServerAddr,omitempty"`
	Sdk                    int                   `json:"sdk,omitempty"`
	AgentVersion           string                `json:"agentVersion,omitempty"`
	Display                *androidutils.Display `json:"display,omitempty"`
	Battery                *androidutils.Battery `json:"battery,omitempty"`
	Memory                 *MemoryInfo           `json:"memory,omitempty"` // proc/meminfo
	Cpu                    *CpuInfo              `json:"cpu,omitempty"`    // proc/cpuinfo
	Arch                   string                `json:"arch"`

	Owner    *OwnerInfo `json:"owner" gorethink:"owner,omitempty"`
	Reserved string     `json:"reserved,omitempty"`

	ConnectionCount   int       `json:"-"` // > 1 happended when phone redial server
	CreatedAt         time.Time `json:"-" gorethink:"createdAt,omitempty"`
	PresenceChangedAt time.Time `json:"presenceChangedAt,omitempty"`
	UsingBeganAt      time.Time `json:"usingBeganAt,omitempty" gorethink:"usingBeganAt,omitempty"`

	Ready   *bool `json:"ready,omitempty"`
	Present *bool `json:"present,omitempty"`
	Using   *bool `json:"using,omitempty"`

	Product  *Product  `json:"product" gorethink:"product_id,reference,omitempty" gorethink_ref:"id"`
	Provider *Provider `json:"provider" gorethink:"provider_id,reference,omitempty" gorethink_ref:"id"`

	// only works when there is provider
	ProviderForwardedPort int `json:"providerForwardedPort,omitempty"`

	// used for provider to known agent server url
	ServerURL string `json:"serverUrl,omitempty"`
}

type MemoryInfo

type MemoryInfo struct {
	Total  int    `json:"total"` // unit kB
	Around string `json:"around,omitempty"`
}

type OwnerInfo

type OwnerInfo struct {
	IP string `json:"ip"`
}

type Product

type Product struct {
	Id     string `json:"id" gorethink:"id,omitempty"`
	Name   string `json:"name" gorethink:"name,omitempty"`
	Brand  string `json:"brand" gorethink:"brand,omitempty"`
	Model  string `json:"model" gorethink:"model,omitempty"`
	Memory string `json:"memory,omitempty"` // eg: 4GB
	Cpu    string `json:"cpu,omitempty"`

	Coverage float32 `json:"coverage" gorethink:"coverage,omitempty"`
	Gpu      string  `json:"gpu,omitempty"`
	Link     string  `json:"link,omitempty"` // Outside link

}

"Brand Model Memory CPU" together can define a phone

type Provider

type Provider struct {
	Id                string       `json:"id" gorethink:"id,omitempty"` // machine id
	IP                string       `json:"ip" gorethink:"ip,omitempty"`
	Port              int          `json:"port" gorethink:"port,omitempty"`
	Present           *bool        `json:"present,omitempty"`
	Notes             string       `json:"notes" gorethink:"notes,omitempty"`
	Devices           []DeviceInfo `json:"devices" gorethink:"devices,omitempty"`
	CreatedAt         time.Time    `json:"createdAt,omitempty"`
	PresenceChangedAt time.Time    `json:"presenceChangedAt,omitempty"`
}

u2init

func (*Provider) Addr

func (p *Provider) Addr() string

Addr combined with ip:port

Jump to

Keyboard shortcuts

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