Documentation
¶
Index ¶
- Variables
- func AutoMigrate(db *gorm.DB) error
- func CreateDB(dbUser, dbPass, dbHost, dbName, dbPort string) error
- func FromDBContact(c *Contact) *entities.Contact
- func FromDBRegistrar(dbr *Registrar) *entities.Registrar
- func FromDBTLD(dbtld *TLD) *entities.TLD
- func NewConnection(cfg Config) (*gorm.DB, error)
- func ToDomain(dbDom *Domain) *entities.Domain
- func ToHost(dbHost *Host) *entities.Host
- func ToHostAddress(dbHostAddress *HostAddress) netip.Addr
- func ToIanaRegistrar(dbRegistrar *IANARegistrar) *entities.IANARegistrar
- func ToSpec5Label(label *Spec5Label) *entities.Spec5Label
- type AAAARecordData
- type ARecordData
- type AccreditationRepository
- func (r *AccreditationRepository) CreateAccreditation(ctx context.Context, tldName, rarClID string) error
- func (r *AccreditationRepository) DeleteAccreditation(ctx context.Context, tldName, rarClID string) error
- func (r *AccreditationRepository) ListRegistrarTLDs(ctx context.Context, pageSize int, cursor string, rarClID string) ([]*entities.TLD, error)
- func (r *AccreditationRepository) ListTLDRegistrars(ctx context.Context, pageSize int, cursor string, tldName string) ([]*entities.Registrar, error)
- type ActiveDomainQueryResult
- type CNAMERecordData
- type Config
- type Contact
- type ContactRepository
- func (r *ContactRepository) BulkCreate(ctx context.Context, contacts []*entities.Contact) error
- func (r *ContactRepository) CreateContact(ctx context.Context, c *entities.Contact) (*entities.Contact, error)
- func (r *ContactRepository) DeleteContactByID(ctx context.Context, id string) error
- func (r *ContactRepository) GetContactByID(ctx context.Context, id string) (*entities.Contact, error)
- func (r *ContactRepository) ListContacts(ctx context.Context, params queries.ListItemsQuery) ([]*entities.Contact, string, error)
- func (r *ContactRepository) UpdateContact(ctx context.Context, c *entities.Contact) (*entities.Contact, error)
- type DNSKEYRecordData
- type DNSRecordRepository
- type DSRecordData
- type Domain
- type DomainRepository
- func (dr *DomainRepository) AddHostToDomain(ctx context.Context, domRoID int64, hostRoid int64) error
- func (r *DomainRepository) BulkCreate(ctx context.Context, doms []*entities.Domain) error
- func (dr *DomainRepository) Count(ctx context.Context, filter queries.ListDomainsFilter) (int64, error)
- func (dr *DomainRepository) CountExpiringDomains(ctx context.Context, before time.Time, clid, tld string) (int64, error)
- func (dr *DomainRepository) CountPurgeableDomains(ctx context.Context, after time.Time, clid, tld string) (int64, error)
- func (dr *DomainRepository) CountRestoredDomains(ctx context.Context, clid, tld string) (int64, error)
- func (dr *DomainRepository) Create(ctx context.Context, d *entities.Domain) (*entities.Domain, error)
- func (dr *DomainRepository) DeleteDomainByID(ctx context.Context, id int64) error
- func (dr *DomainRepository) DeleteDomainByName(ctx context.Context, name string) error
- func (dr *DomainRepository) GetActiveDomainGlue(ctx context.Context, tld string) ([]dns.RR, error)
- func (dr *DomainRepository) GetActiveDomainsWithHosts(ctx context.Context, params queries.ActiveDomainsWithHostsQuery) ([]dns.RR, error)
- func (dr *DomainRepository) GetDomainByID(ctx context.Context, id int64, preloadHosts bool) (*entities.Domain, error)
- func (dr *DomainRepository) GetDomainByName(ctx context.Context, name string, preloadHosts bool) (*entities.Domain, error)
- func (dr *DomainRepository) ListDomains(ctx context.Context, params queries.ListItemsQuery) ([]*entities.Domain, string, error)
- func (dr *DomainRepository) ListExpiringDomains(ctx context.Context, before time.Time, pagesize int, clid, tld, cursor string) ([]*entities.Domain, error)
- func (dr *DomainRepository) ListPurgeableDomains(ctx context.Context, after time.Time, pagesize int, clid, cursor, tld string) ([]*entities.Domain, error)
- func (dr *DomainRepository) ListRestoredDomains(ctx context.Context, pagesize int, clid, tld, cursor string) ([]*entities.Domain, error)
- func (dr *DomainRepository) RemoveHostFromDomain(ctx context.Context, domRoID int64, hostRoid int64) error
- func (dr *DomainRepository) UpdateDomain(ctx context.Context, d *entities.Domain) (*entities.Domain, error)
- type FX
- type FXRepository
- func (r *FXRepository) GetByBaseAndTargetCurrency(ctx context.Context, baseCurrency, targetCurrency string) (*entities.FX, error)
- func (r *FXRepository) ListByBaseCurrency(ctx context.Context, baseCurrency string) ([]*entities.FX, error)
- func (r *FXRepository) UpdateAll(ctx context.Context, fxs []*FX) error
- type Fee
- type FeeRepository
- func (r *FeeRepository) CreateFee(ctx context.Context, fee *entities.Fee) (*entities.Fee, error)
- func (r *FeeRepository) DeleteFee(ctx context.Context, phaseID int64, name, currency string) error
- func (r *FeeRepository) GetFee(ctx context.Context, phaseID int64, name, currency string) (*entities.Fee, error)
- type GlueQueryResult
- type GormNNDNRepository
- func (r *GormNNDNRepository) Count(ctx context.Context, filter queries.ListNndnsFilter) (int64, error)
- func (r *GormNNDNRepository) CreateNNDN(ctx context.Context, nndn *entities.NNDN) (*entities.NNDN, error)
- func (r *GormNNDNRepository) DeleteNNDN(ctx context.Context, name string) error
- func (r *GormNNDNRepository) GetNNDN(ctx context.Context, name string) (*entities.NNDN, error)
- func (r *GormNNDNRepository) ListNNDNs(ctx context.Context, params queries.ListItemsQuery) ([]*entities.NNDN, string, error)
- func (r *GormNNDNRepository) UpdateNNDN(ctx context.Context, nndn *entities.NNDN) (*entities.NNDN, error)
- type GormRegistrarRepository
- func (r *GormRegistrarRepository) BulkCreate(ctx context.Context, rars []*entities.Registrar) error
- func (r *GormRegistrarRepository) Count(ctx context.Context) (int64, error)
- func (r *GormRegistrarRepository) Create(ctx context.Context, rar *entities.Registrar) (*entities.Registrar, error)
- func (r *GormRegistrarRepository) Delete(ctx context.Context, clid string) error
- func (r *GormRegistrarRepository) GetByClID(ctx context.Context, clid string, preloadTLDs bool) (*entities.Registrar, error)
- func (r *GormRegistrarRepository) GetByGurID(ctx context.Context, gurID int) (*entities.Registrar, error)
- func (r *GormRegistrarRepository) IsRegistrarAccreditedForTLD(ctx context.Context, tldName, rarClID string) (bool, error)
- func (r *GormRegistrarRepository) List(ctx context.Context, params queries.ListItemsQuery) ([]*entities.RegistrarListItem, string, error)
- func (r *GormRegistrarRepository) Update(ctx context.Context, rar *entities.Registrar) (*entities.Registrar, error)
- type GormTLDRepository
- func (repo *GormTLDRepository) Count(ctx context.Context, filter queries.ListTldsFilter) (int64, error)
- func (repo *GormTLDRepository) Create(ctx context.Context, tld *entities.TLD) error
- func (repo *GormTLDRepository) DeleteByName(ctx context.Context, name string) error
- func (repo *GormTLDRepository) GetByName(ctx context.Context, name string, preloadAll bool) (*entities.TLD, error)
- func (repo *GormTLDRepository) List(ctx context.Context, params queries.ListItemsQuery) ([]*entities.TLD, string, error)
- func (repo *GormTLDRepository) Update(ctx context.Context, tld *entities.TLD) error
- type Host
- type HostAddress
- type HostAddressRepository
- func (r *HostAddressRepository) CreateHostAddress(ctx context.Context, hostRoid int64, addr *netip.Addr) (*netip.Addr, error)
- func (r *HostAddressRepository) DeleteHostAddressByHostRoidAndAddress(ctx context.Context, hostRoid int64, addr *netip.Addr) error
- func (r *HostAddressRepository) GetHostAddressesByHostRoid(ctx context.Context, hostRoid int64) ([]netip.Addr, error)
- type HostRepository
- func (r *HostRepository) BulkCreate(ctx context.Context, hosts []*entities.Host) error
- func (r *HostRepository) CreateHost(ctx context.Context, host *entities.Host) (*entities.Host, error)
- func (r *HostRepository) DeleteHostByRoid(ctx context.Context, roid int64) error
- func (r *HostRepository) GetHostAssociationCount(ctx context.Context, roid int64) (int64, error)
- func (r *HostRepository) GetHostByNameAndClID(ctx context.Context, name string, clid string) (*entities.Host, error)
- func (r *HostRepository) GetHostByRoid(ctx context.Context, roid int64) (*entities.Host, error)
- func (r *HostRepository) ListHosts(ctx context.Context, params queries.ListItemsQuery) ([]*entities.Host, string, error)
- func (r *HostRepository) UpdateHost(ctx context.Context, host *entities.Host) (*entities.Host, error)
- type IANARegistrar
- type IANARegistrarRepository
- func (r *IANARegistrarRepository) Count(ctx context.Context) (int, error)
- func (r *IANARegistrarRepository) GetByGurID(ctx context.Context, gurID int) (*entities.IANARegistrar, error)
- func (r *IANARegistrarRepository) List(ctx context.Context, pageSize int, pageCursor, nameSearchString, status string) ([]*entities.IANARegistrar, error)
- func (r *IANARegistrarRepository) UpdateAll(ctx context.Context, registrars []*entities.IANARegistrar) error
- type MXRecordData
- type NNDN
- type NSRecordData
- type PTRRecordData
- type Phase
- type PhaseRepository
- func (r *PhaseRepository) CreatePhase(ctx context.Context, phase *entities.Phase) (*entities.Phase, error)
- func (r *PhaseRepository) DeletePhaseByTLDAndName(ctx context.Context, tld, name string) error
- func (r *PhaseRepository) GetPhaseByTLDAndName(ctx context.Context, tld, name string) (*entities.Phase, error)
- func (r *PhaseRepository) ListActiveGAPhases(ctx context.Context, pageSize int, pageCursor string) ([]*entities.Phase, error)
- func (r *PhaseRepository) ListPhasesByTLD(ctx context.Context, tld string, pageSize int, pageCursor string) ([]*entities.Phase, error)
- func (r *PhaseRepository) UpdatePhase(ctx context.Context, phase *entities.Phase) (*entities.Phase, error)
- type PremiumLabel
- type PremiumLabelRepository
- func (plr *PremiumLabelRepository) Create(ctx context.Context, premiumLabel *entities.PremiumLabel) (*entities.PremiumLabel, error)
- func (plr *PremiumLabelRepository) DeleteByLabelListAndCurrency(ctx context.Context, label, list, currency string) error
- func (plr *PremiumLabelRepository) GetByLabelListAndCurrency(ctx context.Context, label, list, currency string) (*entities.PremiumLabel, error)
- func (plr *PremiumLabelRepository) List(ctx context.Context, params queries.ListItemsQuery) ([]*entities.PremiumLabel, string, error)
- type PremiumList
- type PremiumListRepository
- func (plr *PremiumListRepository) Create(ctx context.Context, premiumList *entities.PremiumList) (*entities.PremiumList, error)
- func (plr *PremiumListRepository) DeleteByName(ctx context.Context, name string) error
- func (plr *PremiumListRepository) GetByName(ctx context.Context, name string) (*entities.PremiumList, error)
- func (plr *PremiumListRepository) List(ctx context.Context, params queries.ListItemsQuery) ([]*entities.PremiumList, string, error)
- type Price
- type PriceRepository
- func (r *PriceRepository) CreatePrice(ctx context.Context, price *entities.Price) (*entities.Price, error)
- func (r *PriceRepository) DeletePrice(ctx context.Context, phaseID int64, currency string) error
- func (r *PriceRepository) GetPrice(ctx context.Context, phaseID int64, currency string) (*entities.Price, error)
- type Registrar
- type RegistryOperator
- type RegistryOperatorRepository
- func (r *RegistryOperatorRepository) Count(ctx context.Context, filter queries.ListRegistryOperatorsFilter) (int64, error)
- func (r *RegistryOperatorRepository) Create(ctx context.Context, ro *entities.RegistryOperator) (*entities.RegistryOperator, error)
- func (r *RegistryOperatorRepository) DeleteByRyID(ctx context.Context, ryID string) error
- func (r *RegistryOperatorRepository) GetByRyID(ctx context.Context, ryID string) (*entities.RegistryOperator, error)
- func (r *RegistryOperatorRepository) List(ctx context.Context, params queries.ListItemsQuery) ([]*entities.RegistryOperator, string, error)
- func (r *RegistryOperatorRepository) Update(ctx context.Context, ro *entities.RegistryOperator) (*entities.RegistryOperator, error)
- type SOARecordData
- type SRVRecordData
- type Spec5Label
- type Spec5Repository
- type TLD
- type TLDDNSRecord
- type TXTRecordData
Constants ¶
This section is empty.
Variables ¶
var (
ErrInvalidFilterType = errors.New("invalid filter type")
)
Functions ¶
func AutoMigrate ¶
func FromDBContact ¶
FromDBContact converts a database Contact to a domain entities.Contact
func FromDBRegistrar ¶
func ToHostAddress ¶
func ToHostAddress(dbHostAddress *HostAddress) netip.Addr
ToHostAddress converts a postgres.HostAddress to an netip.Addr
func ToIanaRegistrar ¶
func ToIanaRegistrar(dbRegistrar *IANARegistrar) *entities.IANARegistrar
ToIanaRegistrar converts a DB IANARegistrar to a domain IANARegistrar
func ToSpec5Label ¶
func ToSpec5Label(label *Spec5Label) *entities.Spec5Label
ToSpec5Label converts a DBSpec5Label struct to a Spec5Label struct
Types ¶
type AAAARecordData ¶
type AAAARecordData struct {
Address string `json:"address"`
}
AAAARecordData represents the data for an AAAA record use it to marshal/unmarshal the data field in DNSRecord
type ARecordData ¶
type ARecordData struct {
Address string `json:"address"`
}
ARecordData represents the data for an A record use it to marshal/unmarshal the data field in DNSRecord
type AccreditationRepository ¶
type AccreditationRepository struct {
// contains filtered or unexported fields
}
AccreditationRepository implements the AccreditationRepository interface
func NewAccreditationRepository ¶
func NewAccreditationRepository(db *gorm.DB) *AccreditationRepository
NewAccreditationRepository creates a new AccreditationRepository
func (*AccreditationRepository) CreateAccreditation ¶
func (r *AccreditationRepository) CreateAccreditation(ctx context.Context, tldName, rarClID string) error
CreateAccreditation creates a new accreditation
func (*AccreditationRepository) DeleteAccreditation ¶
func (r *AccreditationRepository) DeleteAccreditation(ctx context.Context, tldName, rarClID string) error
DeleteAccreditation deletes an accreditation
type ActiveDomainQueryResult ¶
GetHostsForDomain retrieves the hosts associated with an active domain
type CNAMERecordData ¶
type CNAMERecordData struct {
Target string `json:"target"`
}
CNAMERecordData represents the data for a CNAME record use it to marshal/unmarshal the data field in DNSRecord
type Contact ¶
type Contact struct { // ID is the ID of the contact as provided by the registrar. ID string `gorm:"primaryKey"` RoID int64 `gorm:"uniqueIndex;not null"` // we use the int64 representation of our roid to allow time based sorting using roid Voice string Fax string Email string ClID string CrRr *string UpRr *string AuthInfo string `gorm:"not null"` CreatedAt time.Time UpdatedAt time.Time NameInt string OrgInt string Street1Int string Street2Int string Street3Int string CityInt string SPInt string `gorm:"column:sp_int"` PCInt string `gorm:"column:pc_int"` CCInt string `gorm:"column:cc_int"` NameLoc string OrgLoc string Street1Loc string Street2Loc string Street3Loc string CityLoc string SPLoc string `gorm:"column:sp_loc"` PCLoc string `gorm:"column:pc_loc"` CCLoc string `gorm:"column:cc_loc"` entities.ContactStatus `gorm:"embedded"` entities.ContactDisclose `gorm:"embedded"` // FK relationships with domains DomsWhereRegistrant []*Domain `gorm:"foreignKey:RegistrantID"` DomsWhereAdmin []*Domain `gorm:"foreignKey:AdminID"` DomsWhereTech []*Domain `gorm:"foreignKey:TechID"` DomsWhereBilling []*Domain `gorm:"foreignKey:BillingID"` }
Contact is the Gorm model for the Contact entity.
func ToDBContact ¶
ToDBContact converts a domain entities.Contact to a database Contact
type ContactRepository ¶
type ContactRepository struct {
// contains filtered or unexported fields
}
ContactRepository implements the ContactRepository interface
func NewContactRepository ¶
func NewContactRepository(db *gorm.DB) *ContactRepository
NewContactRepository creates a new ContactRepository
func (*ContactRepository) BulkCreate ¶
BulkCreate creates multiple contacts at once
func (*ContactRepository) CreateContact ¶
func (r *ContactRepository) CreateContact(ctx context.Context, c *entities.Contact) (*entities.Contact, error)
CreateContact creates a new contact
func (*ContactRepository) DeleteContactByID ¶
func (r *ContactRepository) DeleteContactByID(ctx context.Context, id string) error
DeleteContactByID deletes a contact from the database
func (*ContactRepository) GetContactByID ¶
func (r *ContactRepository) GetContactByID(ctx context.Context, id string) (*entities.Contact, error)
GetContactByID retrieves a contact from the database by its ID
func (*ContactRepository) ListContacts ¶
func (r *ContactRepository) ListContacts(ctx context.Context, params queries.ListItemsQuery) ([]*entities.Contact, string, error)
ListContacts returns a list of contacts
func (*ContactRepository) UpdateContact ¶
func (r *ContactRepository) UpdateContact(ctx context.Context, c *entities.Contact) (*entities.Contact, error)
UpdateContact updates a contact in the database
type DNSKEYRecordData ¶
type DNSKEYRecordData struct { Flags uint16 `json:"flags"` Protocol uint8 `json:"protocol"` Algorithm uint8 `json:"algorithm"` PublicKey string `json:"publicKey"` }
DNSKEYRecordData represents the data for a DNSKEY record use it to marshal/unmarshal the data field in DNSRecord
type DNSRecordRepository ¶
type DNSRecordRepository struct {
// contains filtered or unexported fields
}
DNSRecordRepository implements the DNSRecordRepository interface
func NewGormDNSRecordRepository ¶
func NewGormDNSRecordRepository(db *gorm.DB) *DNSRecordRepository
NewGormDNSRecordRepository returns a new DNSRecordRepository using Gorm
func (*DNSRecordRepository) Create ¶
func (r *DNSRecordRepository) Create(ctx context.Context, record *TLDDNSRecord) (*TLDDNSRecord, error)
Create creates a new DNS record in the database
func (*DNSRecordRepository) Delete ¶
func (r *DNSRecordRepository) Delete(ctx context.Context, id int) error
Delete deletes a DNS record from the database
func (*DNSRecordRepository) GetByZone ¶
func (r *DNSRecordRepository) GetByZone(ctx context.Context, zone string) ([]*TLDDNSRecord, error)
GetByZone returns all DNS records for a given zone
type DSRecordData ¶
type DSRecordData struct { KeyTag uint16 `json:"keyTag"` Algorithm uint8 `json:"algorithm"` DigestType uint8 `json:"digestType"` Digest string `json:"digest"` }
DSRecordData represents the data for a DS record use it to marshal/unmarshal the data field in DNSRecord
type Domain ¶
type Domain struct { RoID int64 `gorm:"primaryKey"` Name string `gorm:"uniqueIndex;not null"` OriginalName string UName string RegistrantID *string // These are optional, prohibited or mandatory based on ContactDataPolicy AdminID *string // These are optional, prohibited or mandatory based on ContactDataPolicy TechID *string // These are optional, prohibited or mandatory based on ContactDataPolicy BillingID *string // These are optional, prohibited or mandatory based on ContactDataPolicy ClID string CrRr *string UpRr *string TLDName string `gorm:"not null;foreignKey"` TLD TLD ExpiryDate time.Time `gorm:"not null;index"` DropCatch bool RenewedYears int AuthInfo string `gorm:"not null"` CreatedAt time.Time UpdatedAt time.Time entities.DomainStatus `gorm:"embedded"` entities.DomainRGPStatus `gorm:"embedded"` entities.DomainGrandFathering `gorm:"embedded"` Hosts []Host `gorm:"many2many:domain_hosts;"` }
Domain is the GORM model for the Domain entity
func ToDBDomain ¶
FromDomain converts a domain model *entities.Domain to a Domain
type DomainRepository ¶
type DomainRepository struct {
// contains filtered or unexported fields
}
DomainRepository is the postgres implementation of the DomainRepository Interface
func NewDomainRepository ¶
func NewDomainRepository(db *gorm.DB) *DomainRepository
NewDomainRepository creates a new DomainRepository
func (*DomainRepository) AddHostToDomain ¶
func (dr *DomainRepository) AddHostToDomain(ctx context.Context, domRoID int64, hostRoid int64) error
AddHostToDomain adds a domain_hosts association to the database
func (*DomainRepository) BulkCreate ¶
Bulk Create Creates multiple domains in the repository, useful when importing data. Does not persist Hosts if present
func (*DomainRepository) Count ¶
func (dr *DomainRepository) Count(ctx context.Context, filter queries.ListDomainsFilter) (int64, error)
Count returns the number of domains in the database
func (*DomainRepository) CountExpiringDomains ¶
func (dr *DomainRepository) CountExpiringDomains(ctx context.Context, before time.Time, clid, tld string) (int64, error)
CountExiringDomains returns the number of domains that are expiring within the given number of days
func (*DomainRepository) CountPurgeableDomains ¶
func (dr *DomainRepository) CountPurgeableDomains(ctx context.Context, after time.Time, clid, tld string) (int64, error)
CountPurgeableDomains returns the number of domains that are pending deletion and have passed the grace period
func (*DomainRepository) CountRestoredDomains ¶
func (dr *DomainRepository) CountRestoredDomains(ctx context.Context, clid, tld string) (int64, error)
CountRestoredDomains returns the number of domains that are in pendingRestore state (have been restored using the Domain.Restore() function)
func (*DomainRepository) Create ¶
func (dr *DomainRepository) Create(ctx context.Context, d *entities.Domain) (*entities.Domain, error)
Create creates a new domain in the database
func (*DomainRepository) DeleteDomainByID ¶
func (dr *DomainRepository) DeleteDomainByID(ctx context.Context, id int64) error
DeleteDomain deletes a domain from the database by its id
func (*DomainRepository) DeleteDomainByName ¶
func (dr *DomainRepository) DeleteDomainByName(ctx context.Context, name string) error
DeleteDomain deletes a domain from the database by its name
func (*DomainRepository) GetActiveDomainGlue ¶
GetActiveDomainGlue gets the glue records for a given TLD
func (*DomainRepository) GetActiveDomainsWithHosts ¶
func (dr *DomainRepository) GetActiveDomainsWithHosts(ctx context.Context, params queries.ActiveDomainsWithHostsQuery) ([]dns.RR, error)
GetActiveDomainsWithHosts gets the domains that are flagged as active and their associated hosts This data is used to build the NS records for a given TLD
func (*DomainRepository) GetDomainByID ¶
func (dr *DomainRepository) GetDomainByID(ctx context.Context, id int64, preloadHosts bool) (*entities.Domain, error)
GetDomainByID retrieves a domain from the database by its ID
func (*DomainRepository) GetDomainByName ¶
func (dr *DomainRepository) GetDomainByName(ctx context.Context, name string, preloadHosts bool) (*entities.Domain, error)
GetDomainByName retrieves a domain from the database by its name it returns ErrDomainNotFound if the domain does not exist
func (*DomainRepository) ListDomains ¶
func (dr *DomainRepository) ListDomains(ctx context.Context, params queries.ListItemsQuery) ([]*entities.Domain, string, error)
ListDomains retrieves domains from the database applying optional filters and cursor-based pagination. It constructs a query that orders domain records by their primary key (ro_id) in ascending order. It supports filtering by various domain attributes such as client ID, TLD name, domain name (both exact and partial matches), ROID, and by creation or expiry dates (before/after).
If a page cursor is provided, the query starts after the given ro_id. The query limits the results to (PageSize + 1) records to determine if there is an additional page. If more results exist than PageSize, a new cursor is set to the ro_id of the last returned domain, enabling further pagination.
func (*DomainRepository) ListExpiringDomains ¶
func (dr *DomainRepository) ListExpiringDomains(ctx context.Context, before time.Time, pagesize int, clid, tld, cursor string) ([]*entities.Domain, error)
ListExpiringDomains returns a list of domains that are expiring before the given time. These domain objects have minimal properties filled: RoID, Name and ExpiryDate
func (*DomainRepository) ListPurgeableDomains ¶
func (dr *DomainRepository) ListPurgeableDomains(ctx context.Context, after time.Time, pagesize int, clid, cursor, tld string) ([]*entities.Domain, error)
ListPurgeableDomains returns a list of domains that are pending deletion and have passed the grace period
func (*DomainRepository) ListRestoredDomains ¶
func (dr *DomainRepository) ListRestoredDomains(ctx context.Context, pagesize int, clid, tld, cursor string) ([]*entities.Domain, error)
ListRestoredDomains returns a list of domains that are in pendingRestore state (have been restored using the Domain.Restore() function)
func (*DomainRepository) RemoveHostFromDomain ¶
func (dr *DomainRepository) RemoveHostFromDomain(ctx context.Context, domRoID int64, hostRoid int64) error
RemoveHostFromDomain removes a domain_hosts association from the database
func (*DomainRepository) UpdateDomain ¶
func (dr *DomainRepository) UpdateDomain(ctx context.Context, d *entities.Domain) (*entities.Domain, error)
UpdateDomain updates a domain in the database
type FX ¶
type FX struct { Date time.Time `gorm:"primaryKey"` Base string `gorm:"primaryKey"` Target string `gorm:"primaryKey"` Rate float64 CreatedAt time.Time UpdatedAt time.Time }
FX represents a foreign exchange rate in the database
func (*FX) FromEntity ¶
FromEntity converts an entities.FX struct to an FX struct
type FXRepository ¶
type FXRepository struct {
// contains filtered or unexported fields
}
FXRepository is the GORM implementation of the FXRepository
func NewFXRepository ¶
func NewFXRepository(db *gorm.DB) *FXRepository
NewFXRepository creates a new FXRepository instance
func (*FXRepository) GetByBaseAndTargetCurrency ¶
func (r *FXRepository) GetByBaseAndTargetCurrency(ctx context.Context, baseCurrency, targetCurrency string) (*entities.FX, error)
GetByBaseAndTargetCurrency gets the exchange rate for a base and target currency
func (*FXRepository) ListByBaseCurrency ¶
func (r *FXRepository) ListByBaseCurrency(ctx context.Context, baseCurrency string) ([]*entities.FX, error)
ListByBaseCurrency lists all exchange rates by base currency
type Fee ¶
type Fee struct { Currency string `gorm:"primaryKey"` Name string `gorm:"primaryKey"` Amount uint64 Refundable *bool PhaseID int64 `gorm:"primaryKey"` Phase Phase }
Fee is the GORM model for the phase_fee table. Uses a composite primary key to ensure that a fee with the same currency and name is not inserted twice in a phase
func (*Fee) FromEntity ¶
FromEntity converts a Fee entity to a Fee model
type FeeRepository ¶
FeeRepository is the GORM implementation of the FeeRepository
func NewFeeRepository ¶
func NewFeeRepository(db *gorm.DB) *FeeRepository
NewPhaseFeeRepository creates a new PhaseFeeRepository instance
type GlueQueryResult ¶
GlueQueryResult is a struct to hold the results of a query for glue records This is used to build the A or AAAA records (GLUE) for a given TLD These records are needed for in-bailiwick NS records
type GormNNDNRepository ¶
type GormNNDNRepository struct {
// contains filtered or unexported fields
}
GormNNDNRepository implements the Repo interface
func NewGormNNDNRepository ¶
func NewGormNNDNRepository(db *gorm.DB) *GormNNDNRepository
NewGormNNDNRepository returns a new GormNNDNRepository
func (*GormNNDNRepository) Count ¶
func (r *GormNNDNRepository) Count(ctx context.Context, filter queries.ListNndnsFilter) (int64, error)
func (*GormNNDNRepository) CreateNNDN ¶
func (*GormNNDNRepository) DeleteNNDN ¶
func (r *GormNNDNRepository) DeleteNNDN(ctx context.Context, name string) error
func (*GormNNDNRepository) ListNNDNs ¶
func (r *GormNNDNRepository) ListNNDNs(ctx context.Context, params queries.ListItemsQuery) ([]*entities.NNDN, string, error)
func (*GormNNDNRepository) UpdateNNDN ¶
type GormRegistrarRepository ¶
type GormRegistrarRepository struct {
// contains filtered or unexported fields
}
GormRegistrarRepository implements the RegistrarRepository interface
func NewGormRegistrarRepository ¶
func NewGormRegistrarRepository(db *gorm.DB) *GormRegistrarRepository
NewGormRegistrarRepository returns a new GormRegistrarRepository
func (*GormRegistrarRepository) BulkCreate ¶
Bulk Create Creates multiple registrars in the repository
func (*GormRegistrarRepository) Count ¶
func (r *GormRegistrarRepository) Count(ctx context.Context) (int64, error)
Count returns the total number of registrars in the repository
func (*GormRegistrarRepository) Create ¶
func (r *GormRegistrarRepository) Create(ctx context.Context, rar *entities.Registrar) (*entities.Registrar, error)
Create Creates a new Registrar in the repository
func (*GormRegistrarRepository) Delete ¶
func (r *GormRegistrarRepository) Delete(ctx context.Context, clid string) error
Delete Deletes a registrar from the repository
func (*GormRegistrarRepository) GetByClID ¶
func (r *GormRegistrarRepository) GetByClID(ctx context.Context, clid string, preloadTLDs bool) (*entities.Registrar, error)
GetByClID looks up a Regsitrar by ite ClID and returns it
func (*GormRegistrarRepository) GetByGurID ¶
func (r *GormRegistrarRepository) GetByGurID(ctx context.Context, gurID int) (*entities.Registrar, error)
GetByGurID looks up a Registrar by its GurID and returns it TODO: FIXME: This may retrun multiple results (e.g. 9999), so we need to handle this like a list endpoint
func (*GormRegistrarRepository) IsRegistrarAccreditedForTLD ¶
func (r *GormRegistrarRepository) IsRegistrarAccreditedForTLD(ctx context.Context, tldName, rarClID string) (bool, error)
IsRegistrarAccreditedForTLD checks whether the specified registrar is accredited for a particular top-level domain (TLD). It queries the underlying database to match the provided registrar ID and TLD name, returning true if accreditation is confirmed, and false otherwise. Any query error is also returned.
func (*GormRegistrarRepository) List ¶
func (r *GormRegistrarRepository) List(ctx context.Context, params queries.ListItemsQuery) ([]*entities.RegistrarListItem, string, error)
List returns a list of registrars
type GormTLDRepository ¶
type GormTLDRepository struct {
// contains filtered or unexported fields
}
GormTLDRepository implements the TLDRepo interface
func NewGormTLDRepo ¶
func NewGormTLDRepo(db *gorm.DB) *GormTLDRepository
NewGormTLDRepo returns a new GormTLDRepo
func (*GormTLDRepository) Count ¶
func (repo *GormTLDRepository) Count(ctx context.Context, filter queries.ListTldsFilter) (int64, error)
Count returns the total number of TLDs in the database TODO: add a filter to count only TLDs that match a certain criteria
func (*GormTLDRepository) DeleteByName ¶
func (repo *GormTLDRepository) DeleteByName(ctx context.Context, name string) error
Delete deletes a TLD from the database
func (*GormTLDRepository) GetByName ¶
func (repo *GormTLDRepository) GetByName(ctx context.Context, name string, preloadAll bool) (*entities.TLD, error)
GetByName retrieves a TLD by the specified name from the repository. If preloadAll is true, it preloads additional associated phase and pricing and fee details. If no record is found, it returns entities.ErrTLDNotFound; otherwise, it returns any encountered error.
type Host ¶
type Host struct { RoID int64 `gorm:"primaryKey"` Name string `gorm:"uniqueIndex:idx_uniq_name_clid;not null"` ClID string `gorm:"uniqueIndex:idx_uniq_name_clid;not null"` CrRr *string UpRr *string InBailiwick bool CreatedAt time.Time UpdatedAt time.Time entities.HostStatus `gorm:"embedded"` Addresses []HostAddress `gorm:"foreignKey:HostRoID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` // When the parent host is deleted, delete the addresses }
Host is the GORM model for the host table
type HostAddress ¶
type HostAddress struct { HostRoID int64 `gorm:"primaryKey"` Address string `gorm:"primaryKey"` Version int }
HostAddress is the GORM model for the host_address table
func ToDBHostAddress ¶
func ToDBHostAddress(addr netip.Addr, hostRoID int64) *HostAddress
ToDBHostAddress converts a netip.Addr to a postgres.HostAddress
func (HostAddress) TableName ¶
func (HostAddress) TableName() string
TableName returns the table name for the HostAddress model
type HostAddressRepository ¶
type HostAddressRepository struct {
// contains filtered or unexported fields
}
HostAddressRepository is the postgres implementation of the HostAddressRepository
func NewGormHostAddressRepository ¶
func NewGormHostAddressRepository(db *gorm.DB) *HostAddressRepository
NewGormHostAddressRepository creates a new instance of HostAddressRepository
func (*HostAddressRepository) CreateHostAddress ¶
func (r *HostAddressRepository) CreateHostAddress(ctx context.Context, hostRoid int64, addr *netip.Addr) (*netip.Addr, error)
CreateHostAddress creates a new host address
func (*HostAddressRepository) DeleteHostAddressByHostRoidAndAddress ¶
func (r *HostAddressRepository) DeleteHostAddressByHostRoidAndAddress(ctx context.Context, hostRoid int64, addr *netip.Addr) error
DeleteHostAddressByHostRoidAndAddress deletes a host address by the host roid and address
func (*HostAddressRepository) GetHostAddressesByHostRoid ¶
func (r *HostAddressRepository) GetHostAddressesByHostRoid(ctx context.Context, hostRoid int64) ([]netip.Addr, error)
GetHostAddressesByHostRoid gets all host addresses by the host roid
type HostRepository ¶
type HostRepository struct {
// contains filtered or unexported fields
}
HostRepository is the postgres implementation of the HostRepository
func NewGormHostRepository ¶
func NewGormHostRepository(db *gorm.DB) *HostRepository
NewGormHostRepository creates a new instance of HostRepository
func (*HostRepository) BulkCreate ¶
BulkCreate creates multiple hosts in a single transaction. If addresses are provided, they will be created as well Should one of the hosts fail to be created, the operation fails and no hosts are created, the error will be returned
func (*HostRepository) CreateHost ¶
func (r *HostRepository) CreateHost(ctx context.Context, host *entities.Host) (*entities.Host, error)
CreateHost creates a new host and does NOT create the addresses
func (*HostRepository) DeleteHostByRoid ¶
func (r *HostRepository) DeleteHostByRoid(ctx context.Context, roid int64) error
DeleteHostByRoid deletes a host by its roid
func (*HostRepository) GetHostAssociationCount ¶
GetHostAssociationCount returns the number of domains a host is associated with. This can be used to determine if a host needs the linked flag to be unset
func (*HostRepository) GetHostByNameAndClID ¶
func (r *HostRepository) GetHostByNameAndClID(ctx context.Context, name string, clid string) (*entities.Host, error)
GetHostByNameAndClID gets a host by its name and clid
func (*HostRepository) GetHostByRoid ¶
GetHostByRoid gets a host by its roid
func (*HostRepository) ListHosts ¶
func (r *HostRepository) ListHosts(ctx context.Context, params queries.ListItemsQuery) ([]*entities.Host, string, error)
ListHosts lists hosts
func (*HostRepository) UpdateHost ¶
func (r *HostRepository) UpdateHost(ctx context.Context, host *entities.Host) (*entities.Host, error)
UpdateHost updates a host
type IANARegistrar ¶
type IANARegistrar struct { GurID int `gorm:"primary_key;auto_increment:false"` Name string Status string RdapURL string CreatedAt time.Time }
IANARegistrar is a struct representing an IANA Registrar in the database
func ToDBIANARegistrar ¶
func ToDBIANARegistrar(registrar *entities.IANARegistrar) *IANARegistrar
ToDBIANARegistrar converts a domain IANARegistrar to a DB IANARegistrar
func (IANARegistrar) TableName ¶
func (IANARegistrar) TableName() string
type IANARegistrarRepository ¶
type IANARegistrarRepository struct {
// contains filtered or unexported fields
}
IANARegistrarRepository implements the IANARegistrarRepository interface
func NewIANARegistrarRepository ¶
func NewIANARegistrarRepository(db *gorm.DB) *IANARegistrarRepository
NewIANARegistrarRepository returns a new IANARegistrarRepository
func (*IANARegistrarRepository) Count ¶
func (r *IANARegistrarRepository) Count(ctx context.Context) (int, error)
Count returns the number of IANARegistrars in the database
func (*IANARegistrarRepository) GetByGurID ¶
func (r *IANARegistrarRepository) GetByGurID(ctx context.Context, gurID int) (*entities.IANARegistrar, error)
GetByGurID Retrieves gets a IANARegistrar by GurID
func (*IANARegistrarRepository) List ¶
func (r *IANARegistrarRepository) List(ctx context.Context, pageSize int, pageCursor, nameSearchString, status string) ([]*entities.IANARegistrar, error)
ListAll returns all IANARegistrars in the database
func (*IANARegistrarRepository) UpdateAll ¶
func (r *IANARegistrarRepository) UpdateAll(ctx context.Context, registrars []*entities.IANARegistrar) error
UpdateAll updates all IANARegistrars in the database
type MXRecordData ¶
type MXRecordData struct { Preference uint16 `json:"preference"` Exchange string `json:"exchange"` }
MXRecordData represents the data for an MX record use it to marshal/unmarshal the data field in DNSRecord
type NNDN ¶
type NNDN struct { Name string `gorm:"primaryKey"` // ASCII Name as primary key UName string // Unicode Name, should only be populated if the blocked string is an IDN TLDName string `gorm:"not null;foreignKey"` // TLD Name as a foreign key TLD TLD NameState string `gorm:"not null"` // State of the NNDN, not null Reason string // Reason for the NNDN being blocked CreatedAt time.Time UpdatedAt time.Time }
NNDN is the GORM representation of an NNDN object for database interaction.
type NSRecordData ¶
type NSRecordData struct {
Ns string `json:"ns"`
}
NSRecordData represents the data for an NS record use it to marshal/unmarshal the data field in DNSRecord
type PTRRecordData ¶
type PTRRecordData struct {
Ptr string `json:"ptr"`
}
PTRRecordData represents the data for a PTR record use it to marshal/unmarshal the data field in DNSRecord
type Phase ¶
type Phase struct { ID int64 `gorm:"primaryKey"` Name string `gorm:"uniqueIndex:idx_unq_name_tld,not null"` Type string `gorm:"index"` Starts time.Time Ends *time.Time Prices []Price `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE"` Fees []Fee `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE"` PremiumListName *string PremiumList *PremiumList CreatedAt time.Time UpdatedAt time.Time TLDName string `gorm:"uniqueIndex:idx_unq_name_tld,not null"` // TLD TLD // This creates the foreign key relationship entities.PhasePolicy `gorm:"embedded"` }
Phase GORM entity. ID is the primary key and we add a composite unique index ond tldname+name to facilitate human friendly queries
func (*Phase) FromEntity ¶
FromEntity converts a domain model *entities.Phase to a Phase
type PhaseRepository ¶
type PhaseRepository struct {
// contains filtered or unexported fields
}
PhaseRepository is the GORM postgres implementation of the PhaseRepository interface
func NewGormPhaseRepository ¶
func NewGormPhaseRepository(db *gorm.DB) *PhaseRepository
NewGormPhaseRepository creates a new instance of PhaseRepository
func (*PhaseRepository) CreatePhase ¶
func (r *PhaseRepository) CreatePhase(ctx context.Context, phase *entities.Phase) (*entities.Phase, error)
CreatePhase creates a new phase
func (*PhaseRepository) DeletePhaseByTLDAndName ¶
func (r *PhaseRepository) DeletePhaseByTLDAndName(ctx context.Context, tld, name string) error
DeletePhaseByName deletes a phase by its name
func (*PhaseRepository) GetPhaseByTLDAndName ¶
func (r *PhaseRepository) GetPhaseByTLDAndName(ctx context.Context, tld, name string) (*entities.Phase, error)
GetPhaseByTLDAndName gets a phase by its name
func (*PhaseRepository) ListActiveGAPhases ¶
func (r *PhaseRepository) ListActiveGAPhases(ctx context.Context, pageSize int, pageCursor string) ([]*entities.Phase, error)
ListActiveGAPhases lists all active phases for all TLDs
func (*PhaseRepository) ListPhasesByTLD ¶
func (r *PhaseRepository) ListPhasesByTLD(ctx context.Context, tld string, pageSize int, pageCursor string) ([]*entities.Phase, error)
ListPhasesByTLD lists all phases for a TLD
func (*PhaseRepository) UpdatePhase ¶
func (r *PhaseRepository) UpdatePhase(ctx context.Context, phase *entities.Phase) (*entities.Phase, error)
UpdatePhase updates a phase. It will Omit Price and Fee updates. Use specific prices and fees repository for that
type PremiumLabel ¶
type PremiumLabel struct { ID int64 `gorm:"primaryKey"` Label string `gorm:"uniqueIndex:idx_uniq_label_list_cur;not null"` PremiumListName string `gorm:"uniqueIndex:idx_uniq_label_list_cur;not null"` RegistrationAmount uint64 RenewalAmount uint64 TransferAmount uint64 RestoreAmount uint64 Currency string `gorm:"uniqueIndex:idx_uniq_label_list_cur;not null"` Class string }
PremiumLabel represents a premium label in our repository
func FromEntity ¶
func FromEntity(pl *entities.PremiumLabel) *PremiumLabel
FromEntity converts the domain entity to a PremiumLabel
func (PremiumLabel) TableName ¶
func (PremiumLabel) TableName() string
TableName returns the table name for the PremiumLabel model
func (*PremiumLabel) ToEntity ¶
func (pl *PremiumLabel) ToEntity() *entities.PremiumLabel
ToEntity converts the PremiumLabel to a domain entity
type PremiumLabelRepository ¶
type PremiumLabelRepository struct {
// contains filtered or unexported fields
}
PremiumListRepository implements the PremiumListRepository interface
func NewGORMPremiumLabelRepository ¶
func NewGORMPremiumLabelRepository(db *gorm.DB) *PremiumLabelRepository
NewPremiumListRepository creates a new PremiumListRepository instance
func (*PremiumLabelRepository) Create ¶
func (plr *PremiumLabelRepository) Create(ctx context.Context, premiumLabel *entities.PremiumLabel) (*entities.PremiumLabel, error)
Create creates a new premium list in the database
func (*PremiumLabelRepository) DeleteByLabelListAndCurrency ¶
func (plr *PremiumLabelRepository) DeleteByLabelListAndCurrency(ctx context.Context, label, list, currency string) error
DeleteByLabelListAndCurrency deletes a premium label by label, list, and currency
func (*PremiumLabelRepository) GetByLabelListAndCurrency ¶
func (plr *PremiumLabelRepository) GetByLabelListAndCurrency(ctx context.Context, label, list, currency string) (*entities.PremiumLabel, error)
GetByLabelListAndCurrency retrieves a premium label by label, list, and currency
func (*PremiumLabelRepository) List ¶
func (plr *PremiumLabelRepository) List(ctx context.Context, params queries.ListItemsQuery) ([]*entities.PremiumLabel, string, error)
List retrieves a list of premium labels
type PremiumList ¶
type PremiumList struct { Name string `gorm:"primaryKey"` RyID string CreatedAt time.Time UpdatedAt time.Time PremiumLabels []PremiumLabel `gorm:"foreignKey:PremiumListName;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"` }
PremiumList represents a premium list in our repository
func (*PremiumList) FromEntity ¶
func (pl *PremiumList) FromEntity(premiumList *entities.PremiumList)
FromEntity converts a domain entity to a PremiumList
func (*PremiumList) TableName ¶
func (pl *PremiumList) TableName() string
TableName returns the table name for the PremiumList model
func (*PremiumList) ToEntity ¶
func (pl *PremiumList) ToEntity() *entities.PremiumList
ToEntity converts a PremiumList to a domain entity
type PremiumListRepository ¶
type PremiumListRepository struct {
// contains filtered or unexported fields
}
PremiumListRepository implements the PremiumListRepository interface
func NewGORMPremiumListRepository ¶
func NewGORMPremiumListRepository(db *gorm.DB) *PremiumListRepository
NewPremiumListRepository creates a new PremiumListRepository instance
func (*PremiumListRepository) Create ¶
func (plr *PremiumListRepository) Create(ctx context.Context, premiumList *entities.PremiumList) (*entities.PremiumList, error)
Create creates a new premium list in the database
func (*PremiumListRepository) DeleteByName ¶
func (plr *PremiumListRepository) DeleteByName(ctx context.Context, name string) error
DeleteByName deletes a premium list by name
func (*PremiumListRepository) GetByName ¶
func (plr *PremiumListRepository) GetByName(ctx context.Context, name string) (*entities.PremiumList, error)
GetByName retrieves a premium list by name
func (*PremiumListRepository) List ¶
func (plr *PremiumListRepository) List(ctx context.Context, params queries.ListItemsQuery) ([]*entities.PremiumList, string, error)
List retrieves premium lists
type Price ¶
type Price struct { Currency string `gorm:"primaryKey"` RegistrationAmount uint64 RenewalAmount uint64 TransferAmount uint64 RestoreAmount uint64 PhaseID int64 `gorm:"primaryKey"` Phase Phase }
Price is the GORM model for the phase_price table. We use a composite primary key to ensure that a price with the same currency is not inserted twice in the same phase
func (*Price) FromEntity ¶
FromEntitye converst an entities.PhasePrice to a postgres.PhasePrice
type PriceRepository ¶
type PriceRepository struct {
// contains filtered or unexported fields
}
PriceRepository is the GORM implementation of the PriceRepository
func NewGormPriceRepository ¶
func NewGormPriceRepository(db *gorm.DB) *PriceRepository
NewGormPriceRepository creates a new GormPriceRepository
func (*PriceRepository) CreatePrice ¶
func (r *PriceRepository) CreatePrice(ctx context.Context, price *entities.Price) (*entities.Price, error)
CreatePrice creates a new price in the database
func (*PriceRepository) DeletePrice ¶
DeletePrice deletes a price from the database
type Registrar ¶
type Registrar struct { ClID string `gorm:"primary_key"` Name string `gorm:"unique;not null"` NickName string `gorm:"unique;not null"` GurID int Email string Status string `gorm:"not null"` IANAStatus string Autorenew bool Street1Int string Street2Int string Street3Int string CityInt string SPInt string `gorm:"column:sp_int"` PCInt string `gorm:"column:pc_int"` CCInt string `gorm:"column:cc_int"` Street1Loc string Street2Loc string Street3Loc string CityLoc string SPLoc string `gorm:"column:sp_loc"` PCLoc string `gorm:"column:pc_loc"` CCLoc string `gorm:"column:cc_loc"` Voice string Fax string URL string Whois43 string Whois80 string RdapBaseUrl string CreatedAt time.Time UpdatedAt time.Time // FK relationships with contacts Contacts []*Contact `gorm:"foreignKey:ClID"` ContactsCreated []*Contact `gorm:"foreignKey:CrRr"` ContactsUpdated []*Contact `gorm:"foreignKey:UpRr"` // FK relationships with hosts Hosts []*Host `gorm:"foreignKey:ClID"` HostsCreated []*Host `gorm:"foreignKey:CrRr"` HostsUpdated []*Host `gorm:"foreignKey:UpRr"` // FK relationships with domains Domains []*Domain `gorm:"foreignKey:ClID"` DomainsCreated []*Domain `gorm:"foreignKey:CrRr"` DomainsUpdated []*Domain `gorm:"foreignKey:UpRr"` // Many to Many relationship with TLDs TLDs []TLD `gorm:"many2many:accreditations;"` }
Registrar is the GORM representation of a Registrar
func ToDBRegistrar ¶
type RegistryOperator ¶
type RegistryOperator struct { RyID string `gorm:"primary_key"` Name string `gorm:"unique;not null"` URL string Email string `gorm:"not null"` Voice string Fax string CreatedAt time.Time UpdatedAt time.Time TLDs []*TLD `gorm:"foreignKey:RyID"` PremiumLists []*PremiumList `gorm:"foreignKey:RyID"` }
RegistryOperator represents a registry Operator Entity in our repository
func (*RegistryOperator) FromEntity ¶
func (ro *RegistryOperator) FromEntity(e *entities.RegistryOperator)
FromEntity converts the entity to a RegistryOperator
func (RegistryOperator) TableName ¶
func (RegistryOperator) TableName() string
TableName returns the table name for the RegistryOperator entity
func (*RegistryOperator) ToEntity ¶
func (ro *RegistryOperator) ToEntity() *entities.RegistryOperator
ToEntity converts the RegistryOperator to an entity
type RegistryOperatorRepository ¶
type RegistryOperatorRepository struct {
// contains filtered or unexported fields
}
RegistryOperatorRepository implements the RegistryOperatorRepository interface
func NewGORMRegistryOperatorRepository ¶
func NewGORMRegistryOperatorRepository(db *gorm.DB) *RegistryOperatorRepository
NewGORMRegistryOperatorRepository creates a new RegistryOperatorRepository
func (*RegistryOperatorRepository) Count ¶
func (r *RegistryOperatorRepository) Count(ctx context.Context, filter queries.ListRegistryOperatorsFilter) (int64, error)
func (*RegistryOperatorRepository) Create ¶
func (r *RegistryOperatorRepository) Create(ctx context.Context, ro *entities.RegistryOperator) (*entities.RegistryOperator, error)
Create creates a new RegistryOperator in the database
func (*RegistryOperatorRepository) DeleteByRyID ¶
func (r *RegistryOperatorRepository) DeleteByRyID(ctx context.Context, ryID string) error
DeleteByRyID deletes a RegistryOperator by its RyID
func (*RegistryOperatorRepository) GetByRyID ¶
func (r *RegistryOperatorRepository) GetByRyID(ctx context.Context, ryID string) (*entities.RegistryOperator, error)
GetByRyID retrieves a RegistryOperator by its RyID
func (*RegistryOperatorRepository) List ¶
func (r *RegistryOperatorRepository) List(ctx context.Context, params queries.ListItemsQuery) ([]*entities.RegistryOperator, string, error)
List retrieves RegistryOperators from the database
func (*RegistryOperatorRepository) Update ¶
func (r *RegistryOperatorRepository) Update(ctx context.Context, ro *entities.RegistryOperator) (*entities.RegistryOperator, error)
Update updates a RegistryOperator in the database
type SOARecordData ¶
type SOARecordData struct { Ns string `json:"ns"` Mbox string `json:"mbox"` Serial uint32 `json:"serial"` Refresh uint32 `json:"refresh"` Retry uint32 `json:"retry"` Expire uint32 `json:"expire"` Minttl uint32 `json:"minttl"` }
SOARecordData represents the data for a SOA record use it to marshal/unmarshal the data field in DNSRecord
type SRVRecordData ¶
type SRVRecordData struct { Priority uint16 `json:"priority"` Weight uint16 `json:"weight"` Port uint16 `json:"port"` Target string `json:"target"` }
SRVRecordData represents the data for an SRV record use it to marshal/unmarshal the data field in DNSRecord
type Spec5Label ¶
Spec5Label is a struct representing an label blocked by RA Specification 5 in the database
func ToDBSpec5Label ¶
func ToDBSpec5Label(label *entities.Spec5Label) *Spec5Label
ToDBSpec5Label converts a Spec5Label struct to a DBSpec5Label struct
func (Spec5Label) TableName ¶
func (Spec5Label) TableName() string
type Spec5Repository ¶
type Spec5Repository struct {
// contains filtered or unexported fields
}
Spec5Repository implements the Spec5Repository interface
func NewSpec5Repository ¶
func NewSpec5Repository(db *gorm.DB) *Spec5Repository
NewSpec5Repository returns a new Spec5Repository
func (*Spec5Repository) List ¶
func (r *Spec5Repository) List(ctx context.Context, params queries.ListItemsQuery) ([]*entities.Spec5Label, string, error)
ListAll returns all Spec5Labels in the database
func (*Spec5Repository) UpdateAll ¶
func (r *Spec5Repository) UpdateAll(ctx context.Context, labels []*entities.Spec5Label) error
UpdateAll updates all Spec5Labels in the database
type TLD ¶
type TLD struct { Name string `gorm:"primary_key"` Type string `gorm:"index"` UName string AllowEscrowImport bool EnableDNS bool // One to Many relationship with Phases Phases []Phase `gorm:"foreignKey:TLDName;references:Name;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"` // FK relationship with RegistryOperator RyID string CreatedAt time.Time UpdatedAt time.Time // Many to Many relationship with Registrars (AKA accreditations) Registrars []Registrar `gorm:"many2many:accreditations;"` // FK relationships with domains DNSRecord []*TLDDNSRecord `gorm:"foreignKey:Zone"` }
TLD is a GORM struct representing a TLD in the database
type TLDDNSRecord ¶
type TLDDNSRecord struct { ID int `json:"id"` Zone string `json:"zone" gorm:"index"` Name string `json:"name"` Type string `json:"type"` TTL uint32 `json:"ttl"` Data string `json:"data"` // JSON serialized data Priority *uint16 `json:"priority,omitempty"` Weight *uint16 `json:"weight,omitempty"` Port *uint16 `json:"port,omitempty"` Target *string `json:"target,omitempty"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
TLDDNSRecord represents a DNS record in the database
func ConvertRRToDNSRecord ¶
func ConvertRRToDNSRecord(rr dns.RR) (*TLDDNSRecord, error)
ConvertRRToDNSRecord converts a dns.RR to a DNSRecord
func (TLDDNSRecord) TableName ¶
func (TLDDNSRecord) TableName() string
TableName returns the table name for the DNSRecord model
type TXTRecordData ¶
type TXTRecordData struct {
Text string `json:"text"`
}
TXTRecordData represents the data for a TXT record use it to marshal/unmarshal the data field in DNSRecord
Source Files
¶
- accreditation_repository.go
- connection.go
- contact.go
- contact_repository.go
- domain.go
- domain_repository.go
- errors.go
- fee.go
- fee_repository.go
- fx.go
- fx_repository.go
- host.go
- hostAddress.go
- hostAddress_repository.go
- host_repository.go
- ianaREgistrar_mapper.go
- ianaRegistrar_repository.go
- nndn.go
- phase.go
- phase_repository.go
- premiumLabel.go
- premiumLabel_repository.go
- premiumList.go
- premiumList_repository.go
- price.go
- price_repository.go
- registrar.go
- registrar_repository.go
- registryOperator.go
- registryOperator_repository.go
- spec5Label_mapper.go
- spec5_repository.go
- tld.go
- tldDNSrecord.go
- tldDNSrecord_repository.go
- tld_repository.go