Versions in this module Expand all Collapse all v0 v0.0.1 Nov 22, 2021 Changes in this version + var ErrLastZoneUser = errors.New("unable to remove last user from zone") + var ErrUserExistingZoneMember = errors.New("user is already a member of this zone") + var ErrUserNotFound = errors.New("user not found") + var ErrUserOwnsZones = errors.New(...) + var ErrZoneNotFound = errors.New("zone not found") + var GroupAdmin = "core.ADMIN" + var GroupEnabled = "core.ENABLED" + func Connect(dsn string) (*gorm.DB, error) + func RecordAdd(db *gorm.DB, record *Record) error + func RecordDelete(db *gorm.DB, record string) (bool, error) + func RecordUpdate(db *gorm.DB, updates *Record) error + func SuffixList() ([]string, error) + func TestSetup() (*gorm.DB, error) + func UserAdd(db *gorm.DB, email string, password string, refer string) error + func UserDelete(db *gorm.DB, email string) error + func UserGroupAdd(db *gorm.DB, uuid string, group string) error + func UserGroupDelete(db *gorm.DB, uuid string, group string) error + func UserResetPassword(db *gorm.DB, email string, password string) error + func ZoneAdd(db *gorm.DB, zone string, user string) error + func ZoneDelete(db *gorm.DB, zone string) (bool, error) + func ZoneRotateDNSSECKey(db *gorm.DB, uuid string) error + func ZoneUserAdd(db *gorm.DB, zoneID string, userEmail string) error + func ZoneUserAuthorized(db *gorm.DB, zoneUuid string, userUuid string) error + func ZoneUserDelete(db *gorm.DB, zoneUuid string, userEmail string) error + type DNSSECKey struct + Base string + DSAlgo int + DSDigest string + DSDigestType int + DSKeyTag int + DSRecordString string + Key string + Private string + func NewKey(zone string) (*DNSSECKey, error) + type Record struct + CreatedAt time.Time + ID string + Label string + Proxy bool + TTL uint32 + Type string + UpdatedAt time.Time + Value string + Zone Zone + ZoneID string + func RecordList(db *gorm.DB, zone string) ([]Record, error) + type User struct + APIKey string + CreatedAt time.Time + Email string + Groups pq.StringArray + ID string + Password string + PasswordHash []byte + Refer string + Token string + UpdatedAt time.Time + func UserFindByAuth(db *gorm.DB, id string) (*User, error) + func UserFindByEmail(db *gorm.DB, email string) (*User, error) + func UserList(db *gorm.DB) ([]User, error) + type Zone struct + CreatedAt time.Time + DNSSEC DNSSECKey + ID string + UpdatedAt time.Time + UserEmails pq.StringArray + Users pq.StringArray + Zone string + func ZoneFind(db *gorm.DB, zone string) (*Zone, error) + func ZoneFindByID(db *gorm.DB, zoneUuid string) (*Zone, error) + func ZoneList(db *gorm.DB) ([]Zone, error) + func ZoneUserGetZones(db *gorm.DB, userUuid string) ([]Zone, error)