Documentation
¶
Index ¶
- type Data
- type Event
- type Function
- type Particle
- func (p *Particle) CallFunction(ph *Photon, function string, command string) (*Function, error)
- func (p *Particle) GetEvent(c chan *Event, name string)
- func (p *Particle) GetPhoton(id string) (*Photon, error)
- func (p *Particle) GetPhotons() ([]*Photon, error)
- func (p *Particle) GetVariable(ph *Photon, variable string) (*Variable, error)
- type Photon
- type Variable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct {
Data string `json:"data"`
TTL string `json:"ttl"`
PublishTime string `json:"published_at"`
PhotonID string `json:"coreid"`
}
Data represent the data struct from the Particle Cloud
type Particle ¶
type Particle struct {
// contains filtered or unexported fields
}
Particle struct to access the Particle Cloud
func (*Particle) CallFunction ¶
CallFunction call a given Particle function on the Photon
func (*Particle) GetPhotons ¶
GetPhotons from the Particle Cloud
type Photon ¶
type Photon struct {
// Particle Cloud defined variables
ID string `json:"id"`
Name string `json:"name"`
Claimed bool `json:"claimed"`
Connected bool `son:"connected"`
Status string `json:"status"`
IPAddress string `json:"ipaddress"`
// Photon software defined variables and functions
Variables []*Variable `json:"variables"`
Functions []*Function `json:"functions"`
}
Photon model for storing a Photon
func (*Photon) GetVariable ¶
GetVariable return the Photon Variable
func (*Photon) HasFunction ¶
HasFunction check if the photon has the given function. Return the result of the search and the index of the function.
func (*Photon) HasVariable ¶
HasVariable check if the photon has the given variable. Return the result of the search and the index of the variable.
func (*Photon) SetVariable ¶
SetVariable set a variable in the photon, if the variable was already added then it is only an update operation, otherwise it is going to add the new variable