Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainRepository ¶
type ChainRepository struct {
// contains filtered or unexported fields
}
ChainRepository holds a list of multiple repositories which can all be tried to resolve addresses and keys
func NewChainRepository ¶
func NewChainRepository() *ChainRepository
NewChainRepository Return a new chain repository
func (*ChainRepository) Add ¶
func (r *ChainRepository) Add(repo Repository) error
Add a new repository to the chain
func (*ChainRepository) Resolve ¶
func (r *ChainRepository) Resolve(addr address.HashAddress) (*Info, error)
Resolve an address through the chained repos
func (*ChainRepository) Upload ¶
func (r *ChainRepository) Upload(addr address.HashAddress, pubKey, address, signature string) error
Upload public key through the chained repos
type Info ¶
type Info struct { Hash string `json:"hash"` PublicKey string `json:"public_key"` Address string `json:"address"` }
Info is a structure returned by the external resolver system
type KeyDownload ¶
type KeyDownload struct { Hash string `json:"hash"` PublicKey string `json:"public_key"` Address string `json:"address"` }
KeyDownload is a JSON structure we download from a resolver server
type KeyUpload ¶
type KeyUpload struct { PublicKey string `json:"public_key"` Address string `json:"address"` Signature string `json:"signature"` }
KeyUpload is a JSON structure we upload to a resolver server
type Repository ¶
type Repository interface { Resolve(addr address.HashAddress) (*Info, error) Upload(addr address.HashAddress, pubKey, resolveAddress, signature string) error }
Repository is the interface to manage address resolving
func NewDHTRepository ¶
func NewDHTRepository() Repository
NewDHTRepository generates a new DHT repository
func NewLocalRepository ¶
func NewLocalRepository(s *account.Service) Repository
NewLocalRepository intializes a local repository
func NewRemoteRepository ¶
func NewRemoteRepository(baseURL string) Repository
NewRemoteRepository creates new remote resolve repository
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service represents a resolver service tied to a specific repository
func KeyRetrievalService ¶
func KeyRetrievalService(repo Repository) *Service
KeyRetrievalService initialises a key retrieval service.