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:
@ -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,
|
||||
|
Reference in New Issue
Block a user