Documentation ¶
Index ¶
- Constants
- Variables
- type ApiClient
- func (a *ApiClient) AddDnsRecord(apiSettings *ApiSettings, record DnsRecord) error
- func (a *ApiClient) AddTxtRecord(apiSettings *ApiSettings, name string, text string, ttl int) error
- func (a *ApiClient) DeleteDnsRecord(apiSettings *ApiSettings, recordId int) error
- func (a *ApiClient) DeleteTxtRecordByName(apiSettings *ApiSettings, name string) error
- func (a *ApiClient) GetDnsRecords(apiSettings *ApiSettings) ([]DnsRecord, error)
- type ApiSettings
- type DnsRecord
- type Domains
- type ErrorResponse
- type GetDataResponse
- type Records
- type RequestContextKey
- type Yandex360ApiMock
- func (y *Yandex360ApiMock) DnsCreateEntryHandler(w http.ResponseWriter, req *http.Request)
- func (y *Yandex360ApiMock) DnsDeleteRecordHandler(w http.ResponseWriter, req *http.Request)
- func (y *Yandex360ApiMock) DnsListHandler(w http.ResponseWriter, req *http.Request)
- func (y *Yandex360ApiMock) Run(addr string) error
- func (y *Yandex360ApiMock) RunDns(port string)
- func (y *Yandex360ApiMock) Stop(ctx context.Context) error
- func (y *Yandex360ApiMock) StopDns(_ context.Context) error
- type Yandex360ApiMockSettings
Constants ¶
View Source
const ( OrganizationContextKey = RequestContextKey("organization") DomainEntriesContextKey = RequestContextKey("domainentries") DnsEntryContextKey = RequestContextKey("dnsentry") )
View Source
const ErrTemplate = `` /* 161-byte string literal not displayed */
View Source
const TXTDataKey = "txtdata"
View Source
const TXTKey = "TXT"
Variables ¶
View Source
var Yandex360ApiMock_TestData = Yandex360ApiMockSettings{ // contains filtered or unexported fields }
Functions ¶
This section is empty.
Types ¶
type ApiClient ¶
type ApiClient struct {
// contains filtered or unexported fields
}
func NewApiClient ¶
func NewApiClient() *ApiClient
func (*ApiClient) AddDnsRecord ¶
func (a *ApiClient) AddDnsRecord(apiSettings *ApiSettings, record DnsRecord) error
func (*ApiClient) AddTxtRecord ¶
func (*ApiClient) DeleteDnsRecord ¶
func (a *ApiClient) DeleteDnsRecord(apiSettings *ApiSettings, recordId int) error
func (*ApiClient) DeleteTxtRecordByName ¶
func (a *ApiClient) DeleteTxtRecordByName(apiSettings *ApiSettings, name string) error
func (*ApiClient) GetDnsRecords ¶
func (a *ApiClient) GetDnsRecords(apiSettings *ApiSettings) ([]DnsRecord, error)
type ApiSettings ¶
type DnsRecord ¶
type DnsRecord struct { Address string `json:"address,omitempty"` Exchange string `json:"exchange,omitempty"` Flag int `json:"flag,omitempty"` Name string `json:"name" binding:"required"` Port int `json:"port,omitempty"` Preference int `json:"preference,omitempty"` Priority int `json:"priority,omitempty"` RecordID int `json:"recordId"` Tag string `json:"tag,omitempty"` Target string `json:"target,omitempty"` Text string `json:"text,omitempty"` TTL int `json:"ttl" binding:"required"` Type string `json:"type" binding:"required"` Value string `json:"value,omitempty"` Weight int `json:"weight,omitempty"` }
type ErrorResponse ¶
type GetDataResponse ¶
type RequestContextKey ¶
type RequestContextKey string
type Yandex360ApiMock ¶
Simplified API-mock
func NewYandex360ApiMock ¶
func NewYandex360ApiMock(settings Yandex360ApiMockSettings) *Yandex360ApiMock
func (*Yandex360ApiMock) DnsCreateEntryHandler ¶
func (y *Yandex360ApiMock) DnsCreateEntryHandler(w http.ResponseWriter, req *http.Request)
func (*Yandex360ApiMock) DnsDeleteRecordHandler ¶
func (y *Yandex360ApiMock) DnsDeleteRecordHandler(w http.ResponseWriter, req *http.Request)
func (*Yandex360ApiMock) DnsListHandler ¶
func (y *Yandex360ApiMock) DnsListHandler(w http.ResponseWriter, req *http.Request)
func (*Yandex360ApiMock) Run ¶
func (y *Yandex360ApiMock) Run(addr string) error
func (*Yandex360ApiMock) RunDns ¶
func (y *Yandex360ApiMock) RunDns(port string)
type Yandex360ApiMockSettings ¶
type Yandex360ApiMockSettings struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.