Remove plural structs not used as struct
This commit is contained in:
parent
eb60145ca2
commit
5d0fe5edb5
7 changed files with 12 additions and 18 deletions
|
|
@ -36,11 +36,11 @@ func (s *InMemoryStorage) ListAllDomains() (storage.Iterator[happydns.Domain], e
|
|||
}
|
||||
|
||||
// ListDomains retrieves all Domains associated to the given User.
|
||||
func (s *InMemoryStorage) ListDomains(u *happydns.User) (happydns.Domains, error) {
|
||||
func (s *InMemoryStorage) ListDomains(u *happydns.User) ([]*happydns.Domain, error) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
|
||||
var domains happydns.Domains
|
||||
var domains []*happydns.Domain
|
||||
for _, domain := range s.domains {
|
||||
if domain.Owner.Equals(u.Id) {
|
||||
domains = append(domains, domain)
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ func (s *InMemoryStorage) ListAllUsers() (storage.Iterator[happydns.User], error
|
|||
}
|
||||
|
||||
// ListUsers retrieves the list of known Users.
|
||||
func (s *InMemoryStorage) ListUsers() (users happydns.Users, err error) {
|
||||
func (s *InMemoryStorage) ListUsers() (users []*happydns.User, err error) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ type DomainStorage interface {
|
|||
ListAllDomains() (Iterator[happydns.Domain], error)
|
||||
|
||||
// ListDomains retrieves all Domains associated to the given User.
|
||||
ListDomains(user *happydns.User) (happydns.Domains, error)
|
||||
ListDomains(user *happydns.User) ([]*happydns.Domain, error)
|
||||
|
||||
// GetDomain retrieves the Domain with the given id and owned by the given User.
|
||||
GetDomain(domainid happydns.Identifier) (*happydns.Domain, error)
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func (s *LevelDBStorage) ListAllDomains() (storage.Iterator[happydns.Domain], er
|
|||
return NewLevelDBIterator[happydns.Domain](s.db, iter), nil
|
||||
}
|
||||
|
||||
func (s *LevelDBStorage) ListDomains(u *happydns.User) (domains happydns.Domains, err error) {
|
||||
func (s *LevelDBStorage) ListDomains(u *happydns.User) (domains []*happydns.Domain, err error) {
|
||||
iter := s.search("domain-")
|
||||
defer iter.Release()
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ package happydns
|
|||
|
||||
type Backup struct {
|
||||
Version int
|
||||
Domains Domains
|
||||
Domains []*Domain
|
||||
DomainsLogs map[string][]*DomainLog
|
||||
Errors []string
|
||||
Providers []*ProviderMessage
|
||||
|
|
|
|||
|
|
@ -56,14 +56,6 @@ type Domain struct {
|
|||
ZoneHistory []Identifier `json:"zone_history" swaggertype:"array,string"`
|
||||
}
|
||||
|
||||
type DomainWithZoneMetadata struct {
|
||||
*Domain
|
||||
ZoneMeta map[string]*ZoneMeta `json:"zone_meta"`
|
||||
}
|
||||
|
||||
// Domains is an array of Domain.
|
||||
type Domains []*Domain
|
||||
|
||||
// HasZone checks if the given Zone's identifier is part of this Domain
|
||||
// history.
|
||||
func (d *Domain) HasZone(zoneId Identifier) (found bool) {
|
||||
|
|
@ -75,6 +67,11 @@ func (d *Domain) HasZone(zoneId Identifier) (found bool) {
|
|||
return
|
||||
}
|
||||
|
||||
type DomainWithZoneMetadata struct {
|
||||
*Domain
|
||||
ZoneMeta map[string]*ZoneMeta `json:"zone_meta"`
|
||||
}
|
||||
|
||||
type DomainUsecase interface {
|
||||
ApplyZoneCorrection(*User, *Domain, *Zone, *ApplyZoneForm) (*Zone, error)
|
||||
ActionOnEditableZone(*User, *Domain, *Zone, func(*Zone) error) (*Zone, error)
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ type User struct {
|
|||
// Id is the User's identifier.
|
||||
Id Identifier `json:"id"`
|
||||
|
||||
// Email is the User's login and mean of contact.
|
||||
// Email is the User's login and means of contact.
|
||||
Email string `json:"email"`
|
||||
|
||||
// CreatedAt is the time when the User logs in for the first time.
|
||||
|
|
@ -56,9 +56,6 @@ func (u *User) JoinNewsletter() bool {
|
|||
return false
|
||||
}
|
||||
|
||||
// Users is a group of User.
|
||||
type Users []*User
|
||||
|
||||
type UserUsecase interface {
|
||||
ChangeUserSettings(*User, UserSettings) error
|
||||
CreateUser(UserInfo) (*User, error)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue