dnspod

package module
v0.0.0-...-388515f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2020 License: BSD-3-Clause Imports: 12 Imported by: 0

README

Build Status Coverage Status Go.Dev reference Go Report Card Release

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppendResponse

type AppendResponse struct {
	Status struct {
		Code    string `json:"code"`
		Message string `json:"message"`
	} `json:"status"`
	Record []Record `json:"record"`
}

type Client

type Client struct {
	AppID     string
	AppToken  string
	Endpoint  string
	UserAgent string
}

func NewClient

func NewClient(appID, appToken string) *Client

func (*Client) AppendLoginToken

func (c *Client) AppendLoginToken(s string) string

func (*Client) Data

func (c *Client) Data() url.Values

func (*Client) Do

func (c *Client) Do(req *http.Request)

type Provider

type Provider struct {
	AppID    string
	AppToken string
	// contains filtered or unexported fields
}

func (*Provider) AppendRecords

func (p *Provider) AppendRecords(ctx context.Context, zone string, recs []libdns.Record) ([]libdns.Record, error)

func (Provider) CaddyModule

func (Provider) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*Provider) DeleteRecords

func (p *Provider) DeleteRecords(ctx context.Context, zone string, recs []libdns.Record) ([]libdns.Record, error)

func (*Provider) GetRecords

func (p *Provider) GetRecords(ctx context.Context, zone string) ([]libdns.Record, error)

func (*Provider) SetRecords

func (p *Provider) SetRecords(ctx context.Context, zone string, recs []libdns.Record) ([]libdns.Record, error)

func (*Provider) UnmarshalCaddyfile

func (p *Provider) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile sets up the DNS provider from Caddyfile tokens. Syntax:

dnspod [<app_id> <app_token>] {
    app_id <app_id>
    app_token <app_token>
}

type Record

type Record struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Type  string `json:"type"`
	TTL   string `json:"ttl"`
	Value string `json:"value"`
}

type RecordResponse

type RecordResponse struct {
	Status struct {
		Code    string `json:"code"`
		Message string `json:"message"`
	} `json:"status"`
	Domain struct {
		ID   string `json:"id"`
		Name string `json:"name"`
	} `json:"domain"`
	Records []Record `json:"records"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL