addressbook

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2017 License: ISC Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IdentityFilename = "publicidentity.xdr"
)

Variables

View Source
var (
	ErrNotFound      = errors.New("nick not found")
	ErrDuplicateNick = errors.New("duplicate nick")
)

Functions

This section is empty.

Types

type AddressBook

type AddressBook struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

AddressBook context.

func New

func New() *AddressBook

New creates a new AddressBook context.

func (*AddressBook) Add

func (a *AddressBook) Add(identity zkidentity.PublicIdentity) (string, error)

Add adds an identity to an AddressBook. The identity is always added and can not fail. The returned error is used to indicate if the nick, which is used as the lookup key, was modified. The caller is responsible for using the correct lookup nick.

func (*AddressBook) All

All returns an unsorted array of zkidentity.PublicIdentity.

func (*AddressBook) Del

Del permanently removes user from the address book.

func (*AddressBook) FindIdentity

FindIdentity returns the identity associated with identity.

func (*AddressBook) FindNick

func (a *AddressBook) FindNick(nick string) (*zkidentity.PublicIdentity, error)

FindNick returns the identity associated with nick.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL