1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

Rename provider handles to *Provider (#914)

This commit is contained in:
Tom Limoncelli
2020-10-26 09:25:30 -04:00
committed by GitHub
parent 29c7ff3a05
commit ca30c9c34f
43 changed files with 318 additions and 318 deletions

View File

@ -12,7 +12,7 @@ const (
endpoint = "https://ccp.netcup.net/run/webservice/servers/endpoint.php?JSON"
)
type api struct {
type netcupProvider struct {
domainIndex map[string]string
nameserversNames []string
credentials struct {
@ -22,7 +22,7 @@ type api struct {
}
}
func (api *api) createRecord(domain string, rec *record) error {
func (api *netcupProvider) createRecord(domain string, rec *record) error {
rec.Delete = false
data := paramUpdateRecords{
Key: api.credentials.apikey,
@ -40,7 +40,7 @@ func (api *api) createRecord(domain string, rec *record) error {
return nil
}
func (api *api) deleteRecord(domain string, rec *record) error {
func (api *netcupProvider) deleteRecord(domain string, rec *record) error {
rec.Delete = true
data := paramUpdateRecords{
Key: api.credentials.apikey,
@ -58,7 +58,7 @@ func (api *api) deleteRecord(domain string, rec *record) error {
return nil
}
func (api *api) modifyRecord(domain string, rec *record) error {
func (api *netcupProvider) modifyRecord(domain string, rec *record) error {
rec.Delete = false
data := paramUpdateRecords{
Key: api.credentials.apikey,
@ -76,7 +76,7 @@ func (api *api) modifyRecord(domain string, rec *record) error {
return nil
}
func (api *api) getRecords(domain string) ([]record, error) {
func (api *netcupProvider) getRecords(domain string) ([]record, error) {
data := paramGetRecords{
Key: api.credentials.apikey,
SessionID: api.credentials.sessionID,
@ -93,7 +93,7 @@ func (api *api) getRecords(domain string) ([]record, error) {
return resp.Records, nil
}
func (api *api) login(apikey, password, customernumber string) error {
func (api *netcupProvider) login(apikey, password, customernumber string) error {
data := paramLogin{
Key: apikey,
Password: password,
@ -112,7 +112,7 @@ func (api *api) login(apikey, password, customernumber string) error {
return nil
}
func (api *api) logout() error {
func (api *netcupProvider) logout() error {
data := paramLogout{
Key: api.credentials.apikey,
SessionID: api.credentials.sessionID,
@ -126,7 +126,7 @@ func (api *api) logout() error {
return nil
}
func (api *api) get(action string, params interface{}) (json.RawMessage, error) {
func (api *netcupProvider) get(action string, params interface{}) (json.RawMessage, error) {
reqParam := request{
Action: action,
Param: params,