Documentation
¶
Index ¶
- Variables
- func InvValidateHelper(w http.ResponseWriter, r *http.Request, options []string, method string) (core.Investor, error)
- func StartServer(portx int, insecure bool)
- type ExplorePageStub
- 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
- type UserRoleStruct
Constants ¶
This section is empty.
Variables ¶
var AdminRPC = map[int][]string{ 1: []string{"/admin/flag", "GET", "projIndex"}, }
AdminRPC is a list of all the endpoints that can be called by admins
var DevRPC = map[int][]string{ 1: []string{"/developer/withdraw", "POST", "amount", "projIndex"}, 2: []string{"/developer/dashboard", "GET"}, 3: []string{"/developer/money/request", "GET", "index", "amount"}, }
DevRPC contains a list of all the developer rpc endpoints
var EntityRPC = map[int][]string{ 1: []string{"/entity/validate", "GET"}, 2: []string{"/entity/stage0", "GET"}, 3: []string{"/entity/stage1", "GET"}, 4: []string{"/entity/stage2", "GET"}, 5: []string{"/entity/addcollateral", "POST", "amount", "collateral"}, 6: []string{"/entity/proposeproject/opensolar", "POST", "projIndex", "fee"}, 7: []string{"/entity/register", "POST", "name", "username", "pwhash", "token", "seedpwd", "entityType"}, 8: []string{"/entity/contractor/dashboard", "GET"}, }
EntityRPC is a list of endpoints that can be called by an entity
var GuaRPC = map[int][]string{ 1: []string{"/guarantor/deposit/xlm", "POST", "amount", "projIndex", "seedpwd"}, 2: []string{"/guarantor/deposit/asset", "POST", "amount", "projIndex", "seedpwd", "assetCode"}, }
GuaRPC contains a list of all guarantor related RPC endpoints
var InvRPC = map[int][]string{ 1: []string{"/investor/register", "POST", "name", "username", "pwhash", "token", "seedpwd"}, 2: []string{"/investor/validate", "GET"}, 3: []string{"/investor/all", "GET"}, 4: []string{"/investor/invest", "POST", "seedpwd", "projIndex", "amount"}, 5: []string{"/investor/vote", "POST", "votes", "projIndex"}, 6: []string{"/investor/localasset", "POST", "assetName"}, 7: []string{"/investor/sendlocalasset", "POST", "assetName", "seedpwd", "destination", "amount"}, 8: []string{"/investor/sendemail", "POST", "message", "to"}, 9: []string{"/investor/dashboard", "GET"}, 10: []string{"/investor/company/set", "POST"}, 11: []string{"/investor/company/details", "POST", "companytype", "name", "legalname", "address", "country", "city", "zipcode", "role"}, }
InvRPC contains a list of all investor related endpoints
var ParticleRPC = map[int][]string{ 1: []string{"/particle/devices", "GET", "accessToken"}, 2: []string{"/particle/productinfo", "GET", "accessToken", "productInfo"}, 3: []string{"/particle/deviceinfo", "GET", "accessToken", "deviceId"}, 4: []string{"/particle/deviceping", "GET", "accessToken", "deviceId"}, 5: []string{"/particle/devicesignal", "GET", "signal", "accessToken"}, 6: []string{"/particle/getdeviceid", "GET", "serialNumber", "accessToken"}, 7: []string{"/particle/diag/last", "GET", "accessToken", "deviceId"}, 8: []string{"/particle/diag/all", "GET", "accessToken", "deviceId"}, 9: []string{"/particle/user/info", "GET", "accessToken"}, 10: []string{"/particle/sims", "GET", "accessToken"}, }
ParticleRPC contains a list of all particle related endpoints
var ProjectRPC = map[int][]string{ 2: []string{"/project/all", "GET"}, 3: []string{"/project/get", "GET", "index"}, 4: []string{"/projects", "GET", "stage"}, 5: []string{"/utils/addhash", "GET", "projIndex", "choice", "choicestr"}, 6: []string{"/tellershutdown", "GET", "projIndex", "deviceId", "tx1", "tx2"}, 7: []string{"/tellerpayback", "GET", "deviceId", "projIndex"}, 8: []string{"/project/get/dashboard", "GET", "index"}, 9: []string{"/explore", "GET"}, 10: []string{"/project/detail", "GET", "index"}, }
ProjectRPC contains a list of all the project related RPC endpoints
var PublicRpc = map[int][]string{ 1: []string{"/public/investor/all"}, 2: []string{"/public/recipient/all"}, 3: []string{"/public/recipient/reputation/top"}, 4: []string{"/public/investor/reputation/top"}, }
PublicRpc contains a list of all public RPC endpoints
var RecpRPC = map[int][]string{ 1: []string{"/recipient/all", "GET"}, 2: []string{"/recipient/register", "POST", "name", "username", "pwhash", "seedpwd"}, 3: []string{"/recipient/validate", "GET"}, 4: []string{"/recipient/payback", "POST", "assetName", "amount", "seedpwd", "projIndex"}, 5: []string{"/recipient/deviceId", "POST", "deviceId"}, 6: []string{"/recipient/startdevice", "POST", "start"}, 7: []string{"/recipient/storelocation", "POST", "location"}, 8: []string{"/recipient/auction/choose/blind", "GET"}, 9: []string{"/recipient/auction/choose/vickrey", "GET"}, 10: []string{"/recipient/auction/choose/time", "GET"}, 11: []string{"/recipient/unlock/opensolar", "POST", "seedpwd", "projIndex"}, 12: []string{"/recipient/addemail", "POST", "email"}, 13: []string{"/recipient/finalize", "POST", "projIndex"}, 14: []string{"/recipient/originate", "POST", "projIndex"}, 15: []string{"/recipient/trustlimit", "GET", "assetName"}, 16: []string{"/recipient/ssh", "POST", "hash"}, 17: []string{"/recipient/onetimeunlock", "POST", "projIndex", "seedpwd"}, 18: []string{"/recipient/register/teller", "POST", "url", "projIndex"}, 19: []string{"/recipient/teller/details", "POST", "projIndex", "url", "brokerurl", "topic"}, 20: []string{"/recipient/dashboard", "GET"}, 21: []string{"/recipient/company/set", "POST"}, 22: []string{"/recipient/company/details", "POST", "companytype", "name", "legalname", "address", "country", "city", "zipcode", "role"}, 23: []string{"/recipient/teller/energy", "POST", "energy"}, }
RecpRPC is a collection of all recipient RPC endpoints and their required params
var StagesRPC = map[int][]string{ 1: []string{"/stages/all", "GET"}, 2: []string{"/stages", "GET", "index"}, 3: []string{"/stages/promote", "GET", "index"}, }
var UserRPC = map[int][]string{ 1: []string{"/update", "POST"}, 2: []string{"/user/report", "POST", "projIndex"}, 3: []string{"/user/info", "GET"}, 4: []string{"/user/register", "POST", "email", "username", "pwhash", "seedpwd"}, 5: []string{"/user/roles", "GET"}, }
UserRPC is a collection of all user RPC endpoints and their required params
Functions ¶
func InvValidateHelper ¶
func InvValidateHelper(w http.ResponseWriter, r *http.Request, options []string, method string) (core.Investor, error)
InvValidateHelper is a helper that validates an investor and returns the investor struct if successful
func StartServer ¶
StartServer starts the opensolar backend server
Types ¶
type ExplorePageStub ¶
type ExplorePageStub struct {
StageDescription interface{}
Name interface{}
Location interface{}
ProjectType interface{}
OriginatorName interface{}
Description interface{}
Bullet1 interface{}
Bullet2 interface{}
Bullet3 interface{}
Solar interface{}
Storage interface{}
Tariff interface{}
Return interface{}
Rating interface{}
Tax interface{}
Acquisition interface{}
MainImage interface{}
Stage int
Index int
Raised float64
Total float64
Backers int
}
ExplorePageStub is used to show brief descriptions of the project on the frontend's explore page
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
type SnRecipient ¶
type SnRecipient struct {
Name string
PublicKey string
ReceivedSolarProjects []string
Reputation float64
}
SnRecipient defines a sanitized recipient