Skip to content
Snippets Groups Projects
Commit 59b65fca authored by Jake Taylor's avatar Jake Taylor
Browse files

cleanup comments

parent b35c5f63
Branches
Tags
1 merge request!170Release
......@@ -19,12 +19,11 @@ import (
// This package wraps the user discovery system
// User Discovery object
type UserDiscovery struct {
ud *ud.Manager
}
// Returns a new user discovery object. Only call this once. It must be called
// NewUserDiscovery returns a new user discovery object. Only call this once. It must be called
// after StartNetworkFollower is called and will fail if the network has never
// been contacted.
// This function technically has a memory leak because it causes both sides of
......@@ -55,7 +54,7 @@ func (ud *UserDiscovery) Register(username string) error {
return ud.ud.Register(username)
}
// Adds a fact for the user to user discovery. Will only succeed if the
// AddFact adds a fact for the user to user discovery. Will only succeed if the
// user is already registered and the system does not have the fact currently
// registered for any user.
// Will fail if the fact string is not well formed.
......@@ -73,14 +72,14 @@ func (ud *UserDiscovery) AddFact(fStr string) (string, error) {
return ud.ud.SendRegisterFact(f)
}
// Confirms a fact first registered via AddFact. The confirmation ID comes from
// ConfirmFact confirms a fact first registered via AddFact. The confirmation ID comes from
// AddFact while the code will come over the associated communications system
func (ud *UserDiscovery) ConfirmFact(confirmationID, code string) error {
return ud.ud.SendConfirmFact(confirmationID, code)
}
// Removes a previously confirmed fact. Will fail if the passed fact string is
// not well formed or if the fact is not associated with this client.
// RemoveFact removes a previously confirmed fact. Will fail if the passed fact string is
// not well-formed or if the fact is not associated with this client.
// Users cannot remove username facts and must instead remove the user.
func (ud *UserDiscovery) RemoveFact(fStr string) error {
f, err := fact.UnstringifyFact(fStr)
......@@ -108,7 +107,7 @@ type SearchCallback interface {
Callback(contacts *ContactList, error string)
}
// Searches for the passed Facts. The factList is the stringification of a
// Search for the passed Facts. The factList is the stringification of a
// fact list object, look at /bindings/list.go for more on that object.
// This will reject if that object is malformed. The SearchCallback will return
// a list of contacts, each having the facts it hit against.
......@@ -141,7 +140,7 @@ type SingleSearchCallback interface {
Callback(contact *Contact, error string)
}
// Searches for the passed Facts. The fact is the stringification of a
// SearchSingle searches for the passed Facts. The fact is the stringification of a
// fact object, look at /bindings/contact.go for more on that object.
// This will reject if that object is malformed. The SearchCallback will return
// a list of contacts, each having the facts it hit against.
......@@ -173,7 +172,7 @@ type LookupCallback interface {
Callback(contact *Contact, error string)
}
// Looks for the contact object associated with the given userID. The
// Lookup the contact object associated with the given userID. The
// id is the byte representation of an id.
// This will reject if that id is malformed. The LookupCallback will return
// the associated contact if it exists.
......@@ -202,7 +201,7 @@ func (ud UserDiscovery) Lookup(idBytes []byte, callback LookupCallback,
}
// MultiLookupCallback returns the result of many paralel lookups
// MultiLookupCallback returns the result of many parallel lookups
type MultiLookupCallback interface {
Callback(Succeeded *ContactList, failed *IdList, errors string)
}
......
......@@ -127,7 +127,6 @@ var udCmd = &cobra.Command{
confirmID := viper.GetString("confirm")
if confirmID != "" {
// TODO: Lookup code
err = userDiscoveryMgr.SendConfirmFact(confirmID, confirmID)
if err != nil {
fmt.Printf("Couldn't confirm fact: %s\n",
......@@ -136,6 +135,8 @@ var udCmd = &cobra.Command{
}
}
// Handle lookup (verification) process
// Note: Cryptographic verification occurs above the bindings layer
lookupIDStr := viper.GetString("lookup")
if lookupIDStr != "" {
lookupID, ok := parseRecipient(lookupIDStr)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment