Documentation ¶
Index ¶
- func GetBiddersHandler(res http.ResponseWriter, req *http.Request)
- func GetEventQueueStatusHandler(res http.ResponseWriter, req *http.Request)
- func GetP2PCountHandler(res http.ResponseWriter, req *http.Request)
- func GetP2PLogsHandler(res http.ResponseWriter, req *http.Request)
- func GetProvisionersHandler(res http.ResponseWriter, req *http.Request)
- func GetRoundInfoHandler(res http.ResponseWriter, req *http.Request)
- func SetStormDBInstance(store *StormDBInstance)
- func StartAPI(eb *eventbus.EventBus, rb *rpcbus.RPCBus)
- type Count
- type EventQueueJSON
- type Member
- type PeerCount
- type PeerJSON
- type ProvisionerJSON
- type RoundInfoJSON
- type Stake
- type StormDBInstance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBiddersHandler ¶
func GetBiddersHandler(res http.ResponseWriter, req *http.Request)
GetBiddersHandler will return a json response. FIXME this is not yet implemented since we dont have the info yet.
func GetEventQueueStatusHandler ¶
func GetEventQueueStatusHandler(res http.ResponseWriter, req *http.Request)
GetEventQueueStatusHandler will return EventQueueJSON json.
func GetP2PCountHandler ¶
func GetP2PCountHandler(res http.ResponseWriter, req *http.Request)
GetP2PCountHandler will return the current peer count.
func GetP2PLogsHandler ¶
func GetP2PLogsHandler(res http.ResponseWriter, req *http.Request)
GetP2PLogsHandler will return PeerJSON json.
func GetProvisionersHandler ¶
func GetProvisionersHandler(res http.ResponseWriter, req *http.Request)
GetProvisionersHandler will return Provisioners json.
func GetRoundInfoHandler ¶
func GetRoundInfoHandler(res http.ResponseWriter, req *http.Request)
GetRoundInfoHandler will return RoundInfoJSON json array.
func SetStormDBInstance ¶
func SetStormDBInstance(store *StormDBInstance)
SetStormDBInstance will set a store.
Types ¶
type Count ¶
type Count struct {
Count int `json:"count"`
}
Count is the struct used to return a count for a API service.
type EventQueueJSON ¶
type EventQueueJSON struct { ID int `storm:"id,increment" json:"id"` // primary key with auto increment Round uint64 `json:"round"` Step uint8 `json:"step"` Message *message.Message `json:"message"` UpdatedAt time.Time `json:"updated_at"` }
EventQueueJSON is used as JSON rapper for eventQueue fields.
type PeerCount ¶
type PeerCount struct { ID string `storm:"id" json:"id"` LastSeen time.Time `storm:"index" json:"last_seen"` }
PeerCount is the struct used to save a peer or remove from a PeerCount collection in the API monitoring database.
type PeerJSON ¶
type PeerJSON struct { ID int `storm:"id,increment" json:"id"` Address string `json:"address"` Type string `storm:"index" json:"type"` Method string `storm:"index" json:"method"` LastSeen time.Time `storm:"index" json:"last_seen"` }
PeerJSON is used as JSON wrapper for peer info fields.
type ProvisionerJSON ¶
type ProvisionerJSON struct { ID uint64 `storm:"id" json:"id"` Set sortedset.Set `json:"set"` Members []*Member `json:"members"` }
ProvisionerJSON represents the Provisioner.
type RoundInfoJSON ¶
type RoundInfoJSON struct { ID int `storm:"id,increment" json:"id"` Round uint64 `storm:"index" json:"round"` Step uint8 `json:"step"` UpdatedAt time.Time `json:"updated_at"` Method string `json:"method"` Name string `json:"name"` }
RoundInfoJSON is used as JSON wrapper for round info fields.
type Stake ¶
type Stake struct { Amount uint64 `json:"amount"` StartHeight uint64 `json:"start_height"` EndHeight uint64 `json:"end_height"` }
Stake represents the Provisioner's stake.
type StormDBInstance ¶
type StormDBInstance struct {
DB *storm.DB
}
StormDBInstance holds db object.
func GetStormDBInstance ¶
func GetStormDBInstance() *StormDBInstance
GetStormDBInstance will return the actual db instance or nil.
func NewStormDBInstance ¶
func NewStormDBInstance(filename string) (*StormDBInstance, error)
NewStormDBInstance creates a new db.
func (*StormDBInstance) Delete ¶
func (bdb *StormDBInstance) Delete(data interface{}) error
Delete will delete data.
func (*StormDBInstance) Find ¶
func (bdb *StormDBInstance) Find(fieldName string, value interface{}, to interface{}) error
Find will find data.
func (*StormDBInstance) Save ¶
func (bdb *StormDBInstance) Save(data interface{}) error
Save will save the data into db.