address

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Book

type Book struct {
	// contains filtered or unexported fields
}

Book reference a list of addresses optionally associated with a name It is not thread safe.

func NewBook

func NewBook() *Book

func (*Book) Add

func (bk *Book) Add(addr crypto.Address, name string)

Add inserts a new address into the address book linked to the specified name. An address can be associated with multiple names, yet each name can only belong to one address. Hence, if a name is reused, it will replace the reference to the previous address. Adding an address without a name is permissible.

func (Book) GetByAddress

func (bk Book) GetByAddress(addr crypto.Address) (names []string, ok bool)

func (Book) GetByName

func (bk Book) GetByName(name string) (addr crypto.Address, ok bool)

func (Book) GetFromNameOrAddress

func (bk Book) GetFromNameOrAddress(addrOrName string) (addr crypto.Address, names []string, ok bool)

func (Book) ImportKeybase

func (bk Book) ImportKeybase(path string) error

func (Book) List

func (bk Book) List() []Entry

type Entry

type Entry struct {
	crypto.Address
	Names []string
}

Jump to

Keyboard shortcuts

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