Documentation
¶
Overview ¶
Package contacts pkg/contacts/contacts.go c3-vis-core
The visor's address book: the people its operator knows, with the skywire keys, mail addresses and payment addresses that reach them. One store serves the CLI, the hypervisor and the visor's apps, so a name set once shows everywhere.
Each contact is a vCard 4.0 file (RFC 6350), so a book exports to and imports from any address book. vCard has no field for a skywire key or a coin address, so those are X- properties; a skywire key is also written as an IMPP skychat URI (RFC 4770), which most clients show as a chat handle.
Local by design: nothing here is published or sent to a peer.
Package contacts pkg/contacts/store.go c3-vis-core
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("contact not found")
ErrNotFound is returned for a UID the book does not hold.
Functions ¶
Types ¶
type Contact ¶
type Contact struct {
UID string `json:"uid"`
Name string `json:"name"`
Keys []cipher.PubKey `json:"keys,omitempty"`
Mail []string `json:"mail,omitempty"`
Payments []Payment `json:"payments,omitempty"`
Groups []string `json:"groups,omitempty"`
Notes string `json:"notes,omitempty"`
}
Contact is one person or service in the book.
type Payment ¶
type Payment struct {
// Coin is the address's URI scheme, e.g. "skycoin" or "bitcoin" (BIP 321).
Coin string `json:"coin"`
Address string `json:"address"`
}
Payment is an address a contact can be paid at.
func ParsePayment ¶
ParsePayment reads a payment URI such as "bitcoin:bc1q...".
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is an address book kept as one <uid>.vcf file per contact in a directory only the visor's user can read: it is the operator's social graph.
func (*Store) Import ¶
Import adds every vCard in r, replacing contacts that share a UID. Nothing is written unless every card reads.