Documentation
¶
Overview ¶
Code generated by model_paginated_gen. DO NOT EDIT.
Index ¶
- type CreateNoteRequest
- type CreateRecordRequest
- type CreateTemplateRequest
- type CreateZoneRequest
- type CustomAXFRSettings
- type GetRecordResponseBody
- type GetRecordsResponseBody
- type GetSettingsResponseBody
- type GetTemplateResponseBody
- type GetTemplatesResponseBody
- type GetZoneNoteResponseBody
- type GetZoneNotesResponseBody
- type GetZoneResponseBody
- type GetZonesResponseBody
- type Nameserver
- type Note
- type PaginatedNote
- type PaginatedRecord
- type PaginatedTemplate
- type PaginatedZone
- type PatchRecordRequest
- type PatchTemplateRequest
- type PatchZoneRequest
- type Record
- type RecordTTL
- type RecordType
- type SafeDNSService
- type Service
- func (s *Service) CreateTemplate(req CreateTemplateRequest) (int, error)
- func (s *Service) CreateTemplateRecord(templateID int, req CreateRecordRequest) (int, error)
- func (s *Service) CreateZone(req CreateZoneRequest) error
- func (s *Service) CreateZoneNote(zoneName string, req CreateNoteRequest) (int, error)
- func (s *Service) CreateZoneRecord(zoneName string, req CreateRecordRequest) (int, error)
- func (s *Service) DeleteTemplate(templateID int) error
- func (s *Service) DeleteTemplateRecord(templateID int, recordID int) error
- func (s *Service) DeleteZone(zoneName string) error
- func (s *Service) DeleteZoneRecord(zoneName string, recordID int) error
- func (s *Service) GetSettings() (Settings, error)
- func (s *Service) GetTemplate(templateID int) (Template, error)
- func (s *Service) GetTemplateRecord(templateID int, recordID int) (Record, error)
- func (s *Service) GetTemplateRecords(templateID int, parameters connection.APIRequestParameters) ([]Record, error)
- func (s *Service) GetTemplateRecordsPaginated(templateID int, parameters connection.APIRequestParameters) (*PaginatedRecord, error)
- func (s *Service) GetTemplates(parameters connection.APIRequestParameters) ([]Template, error)
- func (s *Service) GetTemplatesPaginated(parameters connection.APIRequestParameters) (*PaginatedTemplate, error)
- func (s *Service) GetZone(zoneName string) (Zone, error)
- func (s *Service) GetZoneNote(zoneName string, noteID int) (Note, error)
- func (s *Service) GetZoneNotes(zoneName string, parameters connection.APIRequestParameters) ([]Note, error)
- func (s *Service) GetZoneNotesPaginated(zoneName string, parameters connection.APIRequestParameters) (*PaginatedNote, error)
- func (s *Service) GetZoneRecord(zoneName string, recordID int) (Record, error)
- func (s *Service) GetZoneRecords(zoneName string, parameters connection.APIRequestParameters) ([]Record, error)
- func (s *Service) GetZoneRecordsPaginated(zoneName string, parameters connection.APIRequestParameters) (*PaginatedRecord, error)
- func (s *Service) GetZones(parameters connection.APIRequestParameters) ([]Zone, error)
- func (s *Service) GetZonesPaginated(parameters connection.APIRequestParameters) (*PaginatedZone, error)
- func (s *Service) PatchTemplate(templateID int, patch PatchTemplateRequest) (int, error)
- func (s *Service) PatchTemplateRecord(templateID int, recordID int, patch PatchRecordRequest) (int, error)
- func (s *Service) PatchZone(zoneName string, req PatchZoneRequest) error
- func (s *Service) PatchZoneRecord(zoneName string, recordID int, patch PatchRecordRequest) (int, error)
- func (s *Service) UpdateZoneRecord(zoneName string, record Record) (int, error)
- type Settings
- type Template
- type TemplateNotFoundError
- type TemplateRecordNotFoundError
- type Zone
- type ZoneNotFoundError
- type ZoneNoteNotFoundError
- type ZoneRecordNotFoundError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateNoteRequest ¶
type CreateNoteRequest struct { connection.APIRequestBodyDefaultValidator ContactID int `json:"contact_id,omitempty"` Notes string `json:"notes" validate:"required"` }
CreateNoteRequest represents a request to create a SafeDNS note
func (*CreateNoteRequest) Validate ¶
func (c *CreateNoteRequest) Validate() *connection.ValidationError
Validate returns an error if struct properties are missing/invalid
type CreateRecordRequest ¶
type CreateRecordRequest struct { connection.APIRequestBodyDefaultValidator Name string `json:"name" validate:"required"` TemplateID int `json:"template_id,omitempty"` Type string `json:"type" validate:"required"` Content string `json:"content" validate:"required"` Priority *int `json:"priority,omitempty"` }
CreateRecordRequest represents a request to create a SafeDNS record
func (*CreateRecordRequest) Validate ¶
func (c *CreateRecordRequest) Validate() *connection.ValidationError
Validate returns an error if struct properties are missing/invalid
type CreateTemplateRequest ¶
type CreateTemplateRequest struct { connection.APIRequestBodyDefaultValidator Name string `json:"name" validate:"required"` Default bool `json:"default"` }
CreateTemplateRequest represents a request to create a SafeDNS template
func (*CreateTemplateRequest) Validate ¶
func (c *CreateTemplateRequest) Validate() *connection.ValidationError
Validate returns an error if struct properties are missing/invalid
type CreateZoneRequest ¶
type CreateZoneRequest struct { connection.APIRequestBodyDefaultValidator Name string `json:"name" validate:"required"` Description string `json:"description,omitempty"` }
CreateZoneRequest represents a request to create a SafeDNS zone
func (*CreateZoneRequest) Validate ¶
func (c *CreateZoneRequest) Validate() *connection.ValidationError
Validate returns an error if struct properties are missing/invalid
type CustomAXFRSettings ¶ added in v1.1.12
type CustomAXFRSettings struct { Allowed bool `json:"allowed"` Name []string `json:"name"` IP []connection.IPAddress `json:"ip"` }
CustomAXFRSettings represents SafeDNS account AXFR settings
type GetRecordResponseBody ¶
type GetRecordResponseBody struct { connection.APIResponseBody Data Record `json:"data"` }
GetRecordResponseBody represents the API response body from the GetRecord resource
type GetRecordsResponseBody ¶
type GetRecordsResponseBody struct { connection.APIResponseBody Data []Record `json:"data"` }
GetRecordsResponseBody represents the API response body from the GetRecords resource
type GetSettingsResponseBody ¶ added in v1.1.12
type GetSettingsResponseBody struct { connection.APIResponseBody Data Settings `json:"data"` }
GetSettingsResponseBody represents the API response body from the GetSettings resource
type GetTemplateResponseBody ¶
type GetTemplateResponseBody struct { connection.APIResponseBody Data Template `json:"data"` }
GetTemplateResponseBody represents the API response body from the GetTemplate resource
type GetTemplatesResponseBody ¶
type GetTemplatesResponseBody struct { connection.APIResponseBody Data []Template `json:"data"` }
GetTemplatesResponseBody represents the API response body from the GetTemplates resource
type GetZoneNoteResponseBody ¶
type GetZoneNoteResponseBody struct { connection.APIResponseBody Data Note `json:"data"` }
GetZoneNoteResponseBody represents the API response body from the GetZoneNote resource
type GetZoneNotesResponseBody ¶
type GetZoneNotesResponseBody struct { connection.APIResponseBody Data []Note `json:"data"` }
GetZoneNotesResponseBody represents the API response body from the GetZoneNotes resource
type GetZoneResponseBody ¶
type GetZoneResponseBody struct { connection.APIResponseBody Data Zone `json:"data"` }
GetZoneResponseBody represents the API response body from the GetZone resource
type GetZonesResponseBody ¶
type GetZonesResponseBody struct { connection.APIResponseBody Data []Zone `json:"data"` }
GetZonesResponseBody represents the API response body from the GetZones resource
type Nameserver ¶ added in v1.1.12
type Nameserver struct { Name string `json:"name"` IP connection.IPAddress `json:"ip"` }
Nameserver represents a SafeDNS nameserver
type Note ¶
type Note struct { ID int `json:"id"` ContactID int `json:"contact_id"` Notes string `json:"notes"` CreatedAt connection.DateTime `json:"created_at"` IP connection.IPAddress `json:"ip"` }
Note represents a SafeDNS note
type PaginatedNote ¶ added in v1.1.0
type PaginatedNote struct { *connection.PaginatedBase Items []Note }
PaginatedNote represents a paginated collection of Note
func NewPaginatedNote ¶ added in v1.1.0
func NewPaginatedNote(getFunc connection.PaginatedGetFunc, parameters connection.APIRequestParameters, pagination connection.APIResponseMetadataPagination, items []Note) *PaginatedNote
NewPaginatedNote returns a pointer to an initialized PaginatedNote struct
type PaginatedRecord ¶ added in v1.1.0
type PaginatedRecord struct { *connection.PaginatedBase Items []Record }
PaginatedRecord represents a paginated collection of Record
func NewPaginatedRecord ¶ added in v1.1.0
func NewPaginatedRecord(getFunc connection.PaginatedGetFunc, parameters connection.APIRequestParameters, pagination connection.APIResponseMetadataPagination, items []Record) *PaginatedRecord
NewPaginatedRecord returns a pointer to an initialized PaginatedRecord struct
type PaginatedTemplate ¶ added in v1.1.0
type PaginatedTemplate struct { *connection.PaginatedBase Items []Template }
PaginatedTemplate represents a paginated collection of Template
func NewPaginatedTemplate ¶ added in v1.1.0
func NewPaginatedTemplate(getFunc connection.PaginatedGetFunc, parameters connection.APIRequestParameters, pagination connection.APIResponseMetadataPagination, items []Template) *PaginatedTemplate
NewPaginatedTemplate returns a pointer to an initialized PaginatedTemplate struct
type PaginatedZone ¶ added in v1.1.0
type PaginatedZone struct { *connection.PaginatedBase Items []Zone }
PaginatedZone represents a paginated collection of Zone
func NewPaginatedZone ¶ added in v1.1.0
func NewPaginatedZone(getFunc connection.PaginatedGetFunc, parameters connection.APIRequestParameters, pagination connection.APIResponseMetadataPagination, items []Zone) *PaginatedZone
NewPaginatedZone returns a pointer to an initialized PaginatedZone struct
type PatchRecordRequest ¶
type PatchRecordRequest struct { Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` Content string `json:"content,omitempty"` TTL *RecordTTL `json:"ttl,omitempty"` Priority *int `json:"priority,omitempty"` }
PatchRecordRequest represents a SafeDNS record patch request
func (*PatchRecordRequest) Validate ¶
func (c *PatchRecordRequest) Validate() *connection.ValidationError
Validate returns an error if struct properties are missing/invalid
type PatchTemplateRequest ¶
type PatchTemplateRequest struct { Name string `json:"name,omitempty"` Default *bool `json:"default,omitempty"` }
PatchTemplateRequest represents a SafeDNS template patch request
func (*PatchTemplateRequest) Validate ¶
func (c *PatchTemplateRequest) Validate() *connection.ValidationError
Validate returns an error if struct properties are missing/invalid
type PatchZoneRequest ¶ added in v1.0.29
type PatchZoneRequest struct {
Description string `json:"description,omitempty"`
}
PatchZoneRequest represents a SafeDNS zone patch request
func (*PatchZoneRequest) Validate ¶ added in v1.0.29
func (c *PatchZoneRequest) Validate() *connection.ValidationError
Validate returns an error if struct properties are missing/invalid
type Record ¶
type Record struct { ID int `json:"id"` TemplateID int `json:"template_id"` Name string `json:"name"` Type RecordType `json:"type"` Content string `json:"content"` UpdatedAt connection.DateTime `json:"updated_at"` TTL RecordTTL `json:"ttl"` Priority int `json:"priority"` }
Record represents a SafeDNS record
type RecordTTL ¶
type RecordTTL int
RecordTTL represents the record TTL time in seconds
type RecordType ¶ added in v1.0.7
type RecordType string
const ( RecordTypeA RecordType = "A" RecordTypeAAAA RecordType = "AAAA" RecordTypeCAA RecordType = "CAA" RecordTypeCNAME RecordType = "CNAME" RecordTypeMX RecordType = "MX" RecordTypeSPF RecordType = "SPF" RecordTypeSRV RecordType = "SRV" RecordTypeTXT RecordType = "TXT" RecordTypeNS RecordType = "NS" RecordTypeSOA RecordType = "SOA" RecordTypeAXFR RecordType = "AXFR" )
func (RecordType) String ¶ added in v1.0.7
func (s RecordType) String() string
type SafeDNSService ¶
type SafeDNSService interface { GetZones(parameters connection.APIRequestParameters) ([]Zone, error) GetZonesPaginated(parameters connection.APIRequestParameters) (*PaginatedZone, error) GetZone(zoneName string) (Zone, error) CreateZone(req CreateZoneRequest) error PatchZone(zoneName string, req PatchZoneRequest) error DeleteZone(zoneName string) error GetZoneRecords(zoneName string, parameters connection.APIRequestParameters) ([]Record, error) GetZoneRecordsPaginated(zoneName string, parameters connection.APIRequestParameters) (*PaginatedRecord, error) GetZoneRecord(zoneName string, recordID int) (Record, error) CreateZoneRecord(zoneName string, req CreateRecordRequest) (int, error) UpdateZoneRecord(zoneName string, record Record) (int, error) PatchZoneRecord(zoneName string, recordID int, patch PatchRecordRequest) (int, error) DeleteZoneRecord(zoneName string, recordID int) error GetZoneNotes(zoneName string, parameters connection.APIRequestParameters) ([]Note, error) GetZoneNotesPaginated(zoneName string, parameters connection.APIRequestParameters) (*PaginatedNote, error) GetZoneNote(zoneName string, noteID int) (Note, error) CreateZoneNote(zoneName string, req CreateNoteRequest) (int, error) GetTemplates(parameters connection.APIRequestParameters) ([]Template, error) GetTemplatesPaginated(parameters connection.APIRequestParameters) (*PaginatedTemplate, error) GetTemplate(templateID int) (Template, error) CreateTemplate(req CreateTemplateRequest) (int, error) PatchTemplate(templateID int, patch PatchTemplateRequest) (int, error) DeleteTemplate(templateID int) error GetTemplateRecords(templateID int, parameters connection.APIRequestParameters) ([]Record, error) GetTemplateRecordsPaginated(templateID int, parameters connection.APIRequestParameters) (*PaginatedRecord, error) GetTemplateRecord(templateID int, recordID int) (Record, error) CreateTemplateRecord(templateID int, req CreateRecordRequest) (int, error) PatchTemplateRecord(templateID int, recordID int, patch PatchRecordRequest) (int, error) DeleteTemplateRecord(templateID int, recordID int) error GetSettings() (Settings, error) }
SafeDNSService is an interface for managing SafeDNS
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements SafeDNSService for managing SafeDNS via the UKFast API
func NewService ¶
func NewService(connection connection.Connection) *Service
NewService returns a new instance of SafeDNSService
func (*Service) CreateTemplate ¶
func (s *Service) CreateTemplate(req CreateTemplateRequest) (int, error)
CreateTemplate creates a new SafeDNS template
func (*Service) CreateTemplateRecord ¶
func (s *Service) CreateTemplateRecord(templateID int, req CreateRecordRequest) (int, error)
CreateTemplateRecord creates a new SafeDNS zone record
func (*Service) CreateZone ¶
func (s *Service) CreateZone(req CreateZoneRequest) error
CreateZone creates a new SafeDNS zone
func (*Service) CreateZoneNote ¶
func (s *Service) CreateZoneNote(zoneName string, req CreateNoteRequest) (int, error)
CreateZoneNote creates a new SafeDNS zone note
func (*Service) CreateZoneRecord ¶
func (s *Service) CreateZoneRecord(zoneName string, req CreateRecordRequest) (int, error)
CreateZoneRecord creates a new SafeDNS zone record
func (*Service) DeleteTemplate ¶
DeleteTemplate removes a SafeDNS template
func (*Service) DeleteTemplateRecord ¶
DeleteTemplateRecord removes a SafeDNS template record
func (*Service) DeleteZone ¶
DeleteZone removes a SafeDNS zone
func (*Service) DeleteZoneRecord ¶
DeleteZoneRecord removes a SafeDNS zone record
func (*Service) GetSettings ¶ added in v1.1.12
GetSettings retrieves account settings
func (*Service) GetTemplate ¶
GetTemplate retrieves a single template by ID
func (*Service) GetTemplateRecord ¶
GetTemplateRecord retrieves a single zone record by ID
func (*Service) GetTemplateRecords ¶
func (s *Service) GetTemplateRecords(templateID int, parameters connection.APIRequestParameters) ([]Record, error)
GetTemplateRecords retrieves a list of records
func (*Service) GetTemplateRecordsPaginated ¶
func (s *Service) GetTemplateRecordsPaginated(templateID int, parameters connection.APIRequestParameters) (*PaginatedRecord, error)
GetTemplateRecordsPaginated retrieves a paginated list of templates
func (*Service) GetTemplates ¶
func (s *Service) GetTemplates(parameters connection.APIRequestParameters) ([]Template, error)
GetTemplates retrieves a list of templates
func (*Service) GetTemplatesPaginated ¶
func (s *Service) GetTemplatesPaginated(parameters connection.APIRequestParameters) (*PaginatedTemplate, error)
GetTemplatesPaginated retrieves a paginated list of templates
func (*Service) GetZoneNote ¶
GetZoneNote retrieves a single zone note by ID
func (*Service) GetZoneNotes ¶
func (s *Service) GetZoneNotes(zoneName string, parameters connection.APIRequestParameters) ([]Note, error)
GetZoneNotes retrieves a list of notes
func (*Service) GetZoneNotesPaginated ¶
func (s *Service) GetZoneNotesPaginated(zoneName string, parameters connection.APIRequestParameters) (*PaginatedNote, error)
GetZoneNotesPaginated retrieves a paginated list of zones
func (*Service) GetZoneRecord ¶
GetZoneRecord retrieves a single zone record by ID
func (*Service) GetZoneRecords ¶
func (s *Service) GetZoneRecords(zoneName string, parameters connection.APIRequestParameters) ([]Record, error)
GetZoneRecords retrieves a list of records
func (*Service) GetZoneRecordsPaginated ¶
func (s *Service) GetZoneRecordsPaginated(zoneName string, parameters connection.APIRequestParameters) (*PaginatedRecord, error)
GetZoneRecordsPaginated retrieves a paginated list of zones
func (*Service) GetZones ¶
func (s *Service) GetZones(parameters connection.APIRequestParameters) ([]Zone, error)
GetZones retrieves a list of zones
func (*Service) GetZonesPaginated ¶
func (s *Service) GetZonesPaginated(parameters connection.APIRequestParameters) (*PaginatedZone, error)
GetZonesPaginated retrieves a paginated list of zones
func (*Service) PatchTemplate ¶
func (s *Service) PatchTemplate(templateID int, patch PatchTemplateRequest) (int, error)
PatchTemplate patches a SafeDNS template
func (*Service) PatchTemplateRecord ¶
func (s *Service) PatchTemplateRecord(templateID int, recordID int, patch PatchRecordRequest) (int, error)
PatchTemplateRecord patches a SafeDNS template record
func (*Service) PatchZone ¶ added in v1.0.29
func (s *Service) PatchZone(zoneName string, req PatchZoneRequest) error
PatchZone patches a SafeDNS zone
func (*Service) PatchZoneRecord ¶
func (s *Service) PatchZoneRecord(zoneName string, recordID int, patch PatchRecordRequest) (int, error)
PatchZoneRecord patches a SafeDNS zone record
type Settings ¶ added in v1.1.12
type Settings struct { ID int `json:"id"` Email string `json:"email"` Nameservers []Nameserver `json:"nameservers"` CustomSOAAllowed bool `json:"custom_soa_allowed"` CustomBaseNSAllowed bool `json:"custom_base_ns_allowed"` CustomAXFR CustomAXFRSettings `json:"custom_axfr"` DelegationAllowed bool `json:"delegation_allowed"` Product string `json:"product"` }
Settings represents SafeDNS account settings/configuration
type Template ¶
type Template struct { ID int `json:"id"` Name string `json:"name"` Default bool `json:"default"` CreatedAt connection.Date `json:"created_at"` }
Template represents a SafeDNS template
type TemplateNotFoundError ¶
type TemplateNotFoundError struct {
TemplateID int
}
TemplateNotFoundError indicates a template was not found within SafeDNS
func (*TemplateNotFoundError) Error ¶
func (e *TemplateNotFoundError) Error() string
type TemplateRecordNotFoundError ¶
TemplateRecordNotFoundError indicates a record was not found within SafeDNS
func (*TemplateRecordNotFoundError) Error ¶
func (e *TemplateRecordNotFoundError) Error() string
type ZoneNotFoundError ¶
type ZoneNotFoundError struct {
ZoneName string
}
ZoneNotFoundError indicates a zone was not found within SafeDNS
func (*ZoneNotFoundError) Error ¶
func (e *ZoneNotFoundError) Error() string
type ZoneNoteNotFoundError ¶
ZoneNoteNotFoundError indicates a zone note was not found within SafeDNS
func (*ZoneNoteNotFoundError) Error ¶
func (e *ZoneNoteNotFoundError) Error() string
type ZoneRecordNotFoundError ¶
ZoneRecordNotFoundError indicates a record was not found within SafeDNS
func (*ZoneRecordNotFoundError) Error ¶
func (e *ZoneRecordNotFoundError) Error() string