Documentation ¶
Index ¶
- Variables
- type MockRepository
- func (m *MockRepository) AddDNS(domain, value string)
- func (m *MockRepository) AddEntry(h hash.Hash, domains []string)
- func (m *MockRepository) GetDomains(h hash.Hash) ([]string, error)
- func (m *MockRepository) IsReserved(h hash.Hash) (bool, error)
- func (m *MockRepository) IsValidated(h hash.Hash, pk *bmcrypto.PubKey) (bool, error)
- type RemoteRepository
- type ReservationRepository
Constants ¶
This section is empty.
Variables ¶
var ReservationService = NewRemoteRepository(baseReservedUrl, nil)
Functions ¶
This section is empty.
Types ¶
type MockRepository ¶
MockRepository is a simple repository that allows you to easily mock reserved accounts and organisations
func NewMockRepository ¶
func NewMockRepository() *MockRepository
func (*MockRepository) AddDNS ¶
func (m *MockRepository) AddDNS(domain, value string)
Adds a DNS entry so we can verify
func (*MockRepository) AddEntry ¶
func (m *MockRepository) AddEntry(h hash.Hash, domains []string)
Adds a new entry to the mock reservations
func (*MockRepository) GetDomains ¶
func (m *MockRepository) GetDomains(h hash.Hash) ([]string, error)
GetDomains will return the domains for the given reserved hash, or empty slice when not reserved
func (*MockRepository) IsReserved ¶
func (m *MockRepository) IsReserved(h hash.Hash) (bool, error)
IsReserved will return true when the hash is a reserved hash
func (*MockRepository) IsValidated ¶
IsValidated will check if a hash has a DNS entry with the correct value
type RemoteRepository ¶
type RemoteRepository struct {
// contains filtered or unexported fields
}
RemoteRepository allows you to fetch reservations from a remote server (the keyserver)
func (RemoteRepository) GetDomains ¶
func (r RemoteRepository) GetDomains(h hash.Hash) ([]string, error)
GetDomains will return the domains for the given reserved hash, or empty slice when not reserved
func (RemoteRepository) IsReserved ¶
func (r RemoteRepository) IsReserved(h hash.Hash) (bool, error)
IsReserved will return true when the hash is a reserved hash
func (RemoteRepository) IsValidated ¶
IsValidated will check if a hash has a DNS entry with the correct value
type ReservationRepository ¶
type ReservationRepository interface { IsValidated(h hash.Hash, pk *bmcrypto.PubKey) (bool, error) IsReserved(h hash.Hash) (bool, error) GetDomains(h hash.Hash) ([]string, error) }
func NewRemoteRepository ¶
func NewRemoteRepository(baseUrl string, client *http.Client) ReservationRepository
NewRemoteRepository creates a new repository for fetching reservations through HTTP