Documentation
¶
Index ¶
- Variables
- func EntityValidateHelper(w http.ResponseWriter, r *http.Request) (core.Entity, error)
- func InvValidateHelper(w http.ResponseWriter, r *http.Request, options []string) (core.Investor, error)
- func RecpValidateHelper(w http.ResponseWriter, r *http.Request, options []string) (core.Recipient, error)
- func StartServer(portx int, insecure bool)
- type GetAccessTokenData
- type GetAssetStruct
- type GetEnergyAttributionData
- type GetEnergyStruct
- type GetSwytchUserStruct
- type ParticleDevice
- type ParticleEventStream
- type ParticlePingResponse
- type ParticleProductDevice
- type ParticleProductInfo
- type ParticleUser
- type SerialNumberResponse
- type SignalResponse
- type SnInvestor
- type SnRecipient
- type SnUser
Constants ¶
This section is empty.
Variables ¶
var InvRPC = map[int][]string{ 1: []string{"/investor/register"}, 2: []string{"/investor/validate"}, 3: []string{"/investor/all"}, 4: []string{"/investor/invest", "seedpwd", "projIndex", "amount"}, 5: []string{"/investor/vote", "votes", "projIndex"}, 6: []string{"/investor/localasset", "assetName"}, 7: []string{"/investor/sendlocalasset", "assetName", "seedpwd", "destination", "amount"}, 8: []string{"/investor/sendemail", "message", "to"}, }
InvRPC contains a list of all investor related endpoints
var ParticleRPC = map[int][]string{ 1: []string{"/particle/devices", "accessToken"}, 2: []string{"/particle/productinfo", "accessToken", "productInfo"}, 3: []string{"/particle/deviceinfo", "accessToken", "deviceId"}, 4: []string{"/particle/deviceping", "accessToken", "deviceId"}, 5: []string{"/particle/devicesignal", "signal", "accessToken"}, 6: []string{"/particle/getdeviceid", "serialNumber", "accessToken"}, 7: []string{"/particle/diag/last", "accessToken", "deviceId"}, 8: []string{"/particle/diag/all", "accessToken", "deviceId"}, 9: []string{"/particle/user/info", "accessToken"}, 10: []string{"/particle/sims", "accessToken"}, }
ParticleRPC contains a list of all particle related endpoints
var RecpRPC = map[int][]string{ 1: []string{"/recipient/all"}, 2: []string{"/recipient/register"}, 3: []string{"/recipient/validate"}, 4: []string{"/recipient/payback", "assetName", "amount", "seedpwd", "projIndex"}, 5: []string{"/recipient/deviceId", "deviceId"}, 6: []string{"/recipient/startdevice", "start"}, 7: []string{"/recipient/storelocation", "location"}, 8: []string{"/recipient/auction/choose/blind"}, 9: []string{"/recipient/auction/choose/vickrey"}, 10: []string{"/recipient/auction/choose/time"}, 11: []string{"/recipient/unlock/opensolar", "seedpwd", "projIndex"}, 12: []string{"/recipient/addemail", "email"}, 13: []string{"/recipient/finalize", "projIndex"}, 14: []string{"/recipient/originate", "projIndex"}, 15: []string{"/recipient/trustlimit", "assetName"}, 16: []string{"/recipient/ssh", "hash"}, }
RecpRPC is a collection of all recipient RPC endpoints and their required params
var UserRPC = map[int][]string{ 1: []string{"/user/update"}, }
UserRPC is a collection of all user RPC endpoints and their required params
Functions ¶
func EntityValidateHelper ¶
EntityValidateHelper is a helper that helps validate an entity
func InvValidateHelper ¶
func InvValidateHelper(w http.ResponseWriter, r *http.Request, options []string) (core.Investor, error)
InvValidateHelper is a helper used to validate an investor on the platform
func RecpValidateHelper ¶
func RecpValidateHelper(w http.ResponseWriter, r *http.Request, options []string) (core.Recipient, error)
RecpValidateHelper is a helper that helps validates recipients in routes
func StartServer ¶
StartServer starts the opensolar backend server
Types ¶
type GetAccessTokenData ¶
type GetAccessTokenData struct {
Data []getAccessTokenDataHelper `json:"data"`
}
GetAccessTokenData is a helper struct for the swytch API
type GetAssetStruct ¶
type GetAssetStruct struct {
Data []gA2 `json:"data"`
}
GetAssetStruct is a helper struct for the swytch API
type GetEnergyAttributionData ¶
type GetEnergyAttributionData struct {
Data []getEnergyAttributionHelper `json:"data"`
}
GetEnergyAttributionData is a helper struct for the swytch API
type GetEnergyStruct ¶
type GetEnergyStruct struct {
Data []getEnergyHelper `json:"data"`
}
GetEnergyStruct is a helper struct for the swytch API
type GetSwytchUserStruct ¶
type GetSwytchUserStruct struct {
Data []getSwytchUserStructHelper `json:"data"`
}
GetSwytchUserStruct is a helper struct for the swytch API
type ParticleDevice ¶
type ParticleDevice struct {
Id string `json:"id"`
Name string `json:"name"`
LastApp string `json:"last_app"`
LastIPAddress string `json:"last_ip_address"`
ProductID int `json:"product_id"`
Connected bool `json:"connected"`
PlatformID int `json:"platform_id"`
Cellular bool `json:"cellular"`
Notes string `json:"notes"`
Status string `json:"status"`
SerialNumber string `json:"serial_number"`
CurrentBuildTarget string `json:"current_build_target"`
SystemFirmwareVersion string `json:"system_firmware_version"`
DefaultBuildTarget string `json:"default_build_target"`
}
ParticleDevice is a structure to parse the returned particle.io data
type ParticleEventStream ¶
type ParticleEventStream struct {
Data string `json:"data"`
Ttl string `json:"ttl"`
PublishedAt string `json:"published_at"`
Coreid string `json:"coreid"`
}
ParticleEventStream is a structure to parse returned particle.io data
type ParticlePingResponse ¶
ParticlePingResponse is a structure to parse returned particle.io data
type ParticleProductDevice ¶
type ParticleProductDevice struct {
Id string `json:"id"`
ProductID int `json:"product_id"`
LastIPAddress string `json:"last_ip_address"`
LastHandshakeAt string `json:"last_handshake_at"`
UserID string `json:"user_id"`
Online bool `json:"online"`
Name string `json:"name"`
PlatformID int `json:"platform_id"`
FirmwareProductID int `json:"firmware_product_id"`
Quarantined bool `json:"quarantined"`
Denied bool `json:"denied"`
Development bool `json:"development"`
Groups []string `json:"groups"`
TargetedFirmwareReleaseVersion string `json:"targeted_firmware_release_version"`
SystemFirmwareVersion string `json:"system_firmware_version"`
SerialNumber string `json:"serial_number"`
Owner string `json:"owner"`
}
ParticleProductDevice is a structure to parse returned particle.io data
type ParticleProductInfo ¶
type ParticleProductInfo struct {
Devices []ParticleProductDevice
}
ParticleProductInfo is a structure to parse returned particle.io data
type ParticleUser ¶
type ParticleUser struct {
Username string `json:"username"`
SubscriptionIds []string `json:"subscription_ids"`
AccountInfo struct {
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
CompanyName string `json:"company_name"`
BusinessAccount bool `json:"business_account"`
} `json:"account_info"`
TeamInvites []string `json:"team_invites"`
WifiDeviceCount int `json:"wifi_device_count"`
CellularDeviceCount int `json:"cellular_device_count"`
}
ParticleUser is a structure to parse returned particle.io data
type SerialNumberResponse ¶
type SerialNumberResponse struct {
Ok bool `json:"ok"`
DeviceID string `json:"device_id"`
PlatformID int `json:"platform_id"`
}
SerialNumberResponse is a structure to parse returned particle.io data
type SignalResponse ¶
type SignalResponse struct {
Id string `json:"id"`
Connected bool `json:"connected"`
Signaling bool `json:"signaling"`
}
SignalResponse is a structure to parse returned particle.io data
type SnInvestor ¶
type SnInvestor struct {
Name string
InvestedSolarProjects []string
AmountInvested float64
InvestedBonds []string
InvestedCoops []string
PublicKey string
Reputation float64
}
SnInvestor defines a sanitized investor