Documentation
¶
Index ¶
- func APIKeyExists(_key string, _kycRights bool) error
- func AddressExists(_address string) error
- func ClearCollection(collections ...string) error
- func Delete(collection string, key string, operator string, value interface{}) error
- func Get(collection string, key []string, operator []string, value []interface{}) ([][]byte, error)
- func GetAddressFromID(_id string) (string, error)
- func GetIDFromAddress(_address string) (string, error)
- func GetKnowledgeID(_live bool, _label string) (int, error)
- func GetKnowledgeLabel(_live bool, _id *big.Int) (string, error)
- func GetRepoHashFromName(_live bool, _name string) (string, error)
- func GetRepoNameFromHash(_live bool, _hash string) (string, error)
- func GetSession() (*mgo.Session, error)
- func InitDatabase() error
- func Insert(collection string, structInterface interface{}) error
- func MgoRequest(collection string, s func(*mgo.Collection) error, database ...string) error
- func Notify(_repoHash string, _notification NotificationProposalStarted) error
- func Replace(collection string, whereKey string, whereValue interface{}, ...) error
- func StoreLog(_address string, _logData string, _version string) (string, error)
- func Update(collection string, whereKey string, whereValue interface{}, changeKey []string, ...) error
- func WasUserProposer(_live bool, _hash string, _address string) (bool, error)
- func WasUserValidator(_live bool, _hash string, _address string) (bool, error)
- type AuthorizedAddress
- type KNWLabels
- type KnowledgeLabel
- type LogEntry
- type NotificationProposalStarted
- type Proposal
- type ProposalDetailsContributor
- type ProposalDetailsRepository
- type ProposalDetailsUser
- type ProposalParticipants
- type ProposalVotes
- type Repository
- type RepositoryDetailsUser
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearCollection ¶
ClearCollection clears a collection, returns an error if the request failed
func GetIDFromAddress ¶
GetIDFromAddress func
func GetKnowledgeID ¶
GetKnowledgeID func
func GetKnowledgeLabel ¶
GetKnowledgeLabel func
func GetRepoHashFromName ¶
GetRepoHashFromName func
func GetRepoNameFromHash ¶
GetRepoNameFromHash func
func InitDatabase ¶
func InitDatabase() error
InitDatabase will return an error if the database does not respond to a ping
func MgoRequest ¶
MgoRequest do
func Notify ¶
func Notify(_repoHash string, _notification NotificationProposalStarted) error
Notify func
func Replace ¶
func Replace(collection string, whereKey string, whereValue interface{}, structInterface interface{}) error
Replace replaces an existing entry in the database, returns an error if the request failed
func Update ¶
func Update(collection string, whereKey string, whereValue interface{}, changeKey []string, changeValue []interface{}) error
Update updates an existing entry in the database, returns an error if the request failed
func WasUserProposer ¶
WasUserProposer func
Types ¶
type AuthorizedAddress ¶
type AuthorizedAddress struct {
DitCLI string `json:"dit_cli" bson:"dit_cli"`
DitExplorer string `json:"dit_explorer" bson:"dit_explorer"`
Alice string `json:"alice" bson:"alice"`
}
AuthorizedAddress struct
type KNWLabels ¶
type KNWLabels struct {
Label string `json:"label" bson:"label"`
Balance float64 `json:"balance" bson:"balance"`
RawBalance string `json:"raw_balance" bson:"raw_balance"`
}
KNWLabels struct
type KnowledgeLabel ¶
type KnowledgeLabel struct {
Label string `json:"label" bson:"label"`
ID int `json:"id" bson:"id"`
TotalSupply float64 `json:"total_supply" bson:"total_supply"`
LastActivityDate time.Time `json:"last_activity_date" bson:"last_activity_date"`
}
KnowledgeLabel Struct
type LogEntry ¶
type LogEntry struct {
ID string `json:"id" bson:"id"`
Address string `json:"address" bson:"address"`
Version string `json:"version" bson:"version"`
LogData string `json:"log_data" bson:"log_data"`
}
LogEntry struct
type NotificationProposalStarted ¶
type NotificationProposalStarted struct {
TwitterID string `json:"twitter_id" bson:"twitter_id"`
LiveMode bool `json:"live_mode" bson:"live_mode"`
RepositoryHash string `json:"repository_hash" bson:"repository_hash"`
RepositoryName string `json:"repository_name" bson:"repository_name"`
KNWVoteID int `json:"knw_vote_id" bson:"knw_vote_id"`
KnowledgeLabel string `json:"knowledge_label" bson:"knowledge_label"`
ProposerTwitterID string `json:"proposer_twitter_id" bson:"proposer_twitter_id"`
ProposerGithubID string `json:"proposer_github_handle" bson:"proposer_github_handle"`
Description string `json:"description" bson:"description"`
Identifier string `json:"identifier" bson:"identifier"`
CommitUntil time.Time `json:"commit_until" bson:"commit_until"`
RevealUntil time.Time `json:"reveal_until" bson:"reveal_until"`
}
NotificationProposalStarted struct
type Proposal ¶
type Proposal struct {
ProposalID int `json:"id" bson:"id"`
KNWVoteID int `json:"knw_vote_id" bson:"knw_vote_id"`
KNWLabel string `json:"knw_label" bson:"knw_label"`
Repository string `json:"repository" bson:"repository"`
Proposer string `json:"proposer" bson:"proposer"`
Topic string `json:"topic" bson:"topic"`
Identifier string `json:"identifier" bson:"identifier"`
CreationDate time.Time `json:"creation_date" bson:"creation_date"`
CommitPhaseEnd time.Time `json:"commit_phase_end" bson:"commit_phase_end"`
RevealPhaseEnd time.Time `json:"reveal_phase_end" bson:"reveal_phase_end"`
Finalized bool `json:"finalized" bson:"finalized"`
Accepted bool `json:"accepted" bson:"accepted"`
Votes ProposalVotes `json:"votes" bson:"votes"`
Participants []ProposalParticipants `json:"participants" bson:"participants"`
StakePerParticipant float64 `json:"stake_per_participant" bson:"stake_per_participant"`
TotalStake float64 `json:"total_stake" bson:"total_stake"`
TotalMintedKNW float64 `json:"total_minted_knw" bson:"total_minted_knw"`
}
Proposal struct
type ProposalDetailsContributor ¶
type ProposalDetailsContributor struct {
Address string `json:"address" bson:"address"`
LastActivityDate time.Time `json:"last_activity_date" bson:"last_activity_date"`
EarnedKNW float64 `json:"earned_knw" bson:"earned_knw"`
AmountOfProposals int `json:"amount_of_proposals" bson:"amount_of_proposals"`
AmountOfValidations int `json:"amount_of_validations" bson:"amount_of_validations"`
}
ProposalDetailsContributor struct
type ProposalDetailsRepository ¶
type ProposalDetailsRepository struct {
KNWVoteID int `json:"knw_vote_id" bson:"knw_vote_id"`
VoteDate time.Time `json:"vote_date" bson:"vote_date"`
}
ProposalDetailsRepository struct
type ProposalDetailsUser ¶
type ProposalDetailsUser struct {
KNWVoteID int `json:"knw_vote_id" bson:"knw_vote_id"`
VoteDate time.Time `json:"vote_date" bson:"vote_date"`
UsedKNW float64 `json:"used_knw" bson:"used_knw"`
Stake float64 `json:"stake" bson:"stake"`
IsProposer bool `json:"is_proposer" bson:"is_proposer"`
Opened bool `json:"opened" bson:"opened"`
Finalized bool `json:"finalized" bson:"finalized"`
VotedRight bool `json:"voted_right" bson:"voted_right"`
KNWDifference float64 `json:"knw_difference" bson:"knw_difference"`
}
ProposalDetailsUser struct
type ProposalParticipants ¶
type ProposalParticipants struct {
Address string `json:"address" bson:"address"`
UsedKNW float64 `json:"used_knw" bson:"used_knw"`
Votes float64 `json:"votes" bson:"votes"`
Opened bool `json:"opened" bson:"opened"`
Finalized bool `json:"finalized" bson:"finalized"`
VotedRight bool `json:"voted_right" bson:"voted_right"`
KNWDifference float64 `json:"knw_difference" bson:"knw_difference"`
}
ProposalParticipants struct
type ProposalVotes ¶
type ProposalVotes struct {
ParticipantsFor int `json:"participants_for" bson:"participants_for"`
ParticipantsAgainst int `json:"participants_against" bson:"participants_against"`
ParticipantsUnrevealed int `json:"participants_unrevealed" bson:"participants_unrevealed"`
VotesFor float64 `json:"votes_for" bson:"votes_for"`
VotesAgainst float64 `json:"votes_against" bson:"votes_against"`
VotesUnrevealed float64 `json:"votes_unrevealed" bson:"votes_unrevealed"`
}
ProposalVotes struct
type Repository ¶
type Repository struct {
Hash string `json:"hash" bson:"hash"`
Name string `json:"name" bson:"name"`
Provider string `json:"provider" bson:"provider"`
URL string `json:"url" bson:"url"`
CreationDate time.Time `json:"creation_date" bson:"creation_date"`
LastActivityDate time.Time `json:"last_activity_date" bson:"last_activity_date"`
Majority int `json:"majority" bson:"majority"`
KnowledgeLabels []string `json:"knw_labels" bson:"knw_labels"`
Proposals []ProposalDetailsRepository `json:"proposals" bson:"proposals"`
Contributors []ProposalDetailsContributor `json:"contributors" bson:"contributors"`
}
Repository struct
type RepositoryDetailsUser ¶
type RepositoryDetailsUser struct {
Hash string `json:"hash" bson:"hash"`
Name string `json:"name" bson:"name"`
Provider string `json:"provider" bson:"provider"`
URL string `json:"url" bson:"url"`
Notifications bool `json:"notifications" bson:"notifications"`
LastActivityDate time.Time `json:"last_activity_date" bson:"last_activity_date"`
EarnedKNW float64 `json:"earned_knw" bson:"earned_knw"`
AmountOfProposals int `json:"amount_of_proposals" bson:"amount_of_proposals"`
AmountOfValidations int `json:"amount_of_validations" bson:"amount_of_validations"`
}
RepositoryDetailsUser struct
type User ¶
type User struct {
DitAddress string `json:"dit_address" bson:"dit_address"`
AuthorizedAddresses AuthorizedAddress `json:"authorized_adresses" bson:"authorized_addresses"`
TwitterID string `json:"twitter_id" bson:"twitter_id"`
GitHubID string `json:"github_id" bson:"github_id"`
GitHubToken string `json:"github_token" bson:"github_token"`
MainAccount string `json:"main_account" bson:"main_account"`
XDAIBalance float64 `json:"xdai_balance" bson:"xdai_balance"`
XDITBalance float64 `json:"xdit_balance" bson:"xdit_balance"`
KNWTokensLive []KNWLabels `json:"knw_tokens_live" bson:"knw_tokens_live"`
ProposalsLive []ProposalDetailsUser `json:"proposals_live" bson:"proposals_live"`
RepositoriesLive []RepositoryDetailsUser `json:"repositories_live" bson:"repositories_live"`
KNWTokensDemo []KNWLabels `json:"knw_tokens_demo" bson:"knw_tokens_demo"`
ProposalsDemo []ProposalDetailsUser `json:"proposals_demo" bson:"proposals_demo"`
RepositoriesDemo []RepositoryDetailsUser `json:"repositories_demo" bson:"repositories_demo"`
}
User struct