-
Notifications
You must be signed in to change notification settings - Fork 0
/
provider.go
51 lines (40 loc) · 1.17 KB
/
provider.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package arvancloud
import (
"context"
"fmt"
"sync"
"github.com/libdns/libdns"
)
type Provider struct {
mutex sync.Mutex
APIToken string `json:"api_token,omitempty"`
}
func (p *Provider) GetRecords(ctx context.Context, zone string) ([]libdns.Record, error) {
records, err := p.getRecords(ctx, zone)
if err != nil {
return nil, err
}
return records, nil
}
func (p *Provider) AppendRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error) {
var appended []libdns.Record
for _, record := range records {
err := p.appendRecord(ctx, zone, record)
if err != nil {
return appended, err
}
}
return appended, nil
}
func (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error) {
return nil, fmt.Errorf("TODO: not implemented")
}
func (p *Provider) DeleteRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error) {
return nil, fmt.Errorf("TODO: not implemented")
}
var (
_ libdns.RecordGetter = (*Provider)(nil)
_ libdns.RecordAppender = (*Provider)(nil)
_ libdns.RecordSetter = (*Provider)(nil)
_ libdns.RecordDeleter = (*Provider)(nil)
)