godnsmadeeasy

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: Unlicense Imports: 12 Imported by: 0

README

Build Status

godnsmadeeasy

Api doc: https://api-docs.dnsmadeeasy.com/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Endpoint   string
	Key        string
	Secret     string
	HttpClient *http.Client
}

func NewClient

func NewClient(endpoint string, key string, secret string) *Client

func (*Client) AddRecord

func (client *Client) AddRecord(domainId int,
	recordName string,
	recordType string,
	recordValue string,
	recordGtdLocation string,
	recordTtl int) (Record, error)

add record

func (*Client) AddSingleDomain

func (client *Client) AddSingleDomain(domainName string) (Domain, error)

Add single domain

func (*Client) DeleteRecord

func (client *Client) DeleteRecord(domainId int, recordId int) error

delete record

func (*Client) DeleteSingleDomain

func (client *Client) DeleteSingleDomain(domainId int) error

Delete single domain

func (*Client) GetAllDomains

func (client *Client) GetAllDomains(index string, order string) (DomainsList, error)

Get all domains

func (*Client) GetAllRecords

func (client *Client) GetAllRecords(domainId int) (RecordsList, error)

get all records

func (*Client) GetSingleDomainById

func (client *Client) GetSingleDomainById(domainId int) (Domain, error)

Get single domain by id

func (*Client) GetSingleDomainByName

func (client *Client) GetSingleDomainByName(domainName string) (Domain, error)

Get single domain by name

func (*Client) UpdateRecord

func (client *Client) UpdateRecord(domainId int,
	recordName string,
	recordType string,
	recordValue string,
	recordId int,
	recordGtdLocation string,
	recordTtl int) error

update record

type Domain

type Domain struct {
	Name                string              `json:"name"`
	Id                  int                 `json:"id"`
	Created             int                 `json:"created"`
	DelegateNameServers []string            `json:"delegateNameServers"`
	FolderId            int                 `json:"folderId"`
	GtdEnabled          bool                `json:"gtdEnabled"`
	NameServers         []NameServers       `json:"nameServers"`
	Updated             int                 `json:"updated"`
	ProcessMulti        bool                `json:"processMulti"`
	ActiveThirdParties  []string            `json:"activeThirdParties"`
	PendingActionId     int                 `json:"pendingActionId"`
	VanityId            int                 `json:"vanityId"`
	VanityNameServers   []VanityNameServers `json:"vanityNameServers"`
}

type DomainShort

type DomainShort struct {
	Created            int      `json:"created"`
	FolderId           int      `json:"folderId"`
	GtdEnabled         bool     `json:"gtdEnabled"`
	Updated            int      `json:"updated"`
	ProcessMulti       bool     `json:"processMulti"`
	ActiveThirdParties []string `json:"activeThirdParties"`
	PendingActionId    int      `json:"pendingActionId"`
	Name               string   `json:"name"`
	Id                 int      `json:"id"`
}

type DomainsList

type DomainsList struct {
	TotalRecords  int           `json:"totalRecords"`
	TotalPackages int           `json:"totalPackages"`
	Page          int           `json:"page"`
	Data          []DomainShort `json:"data"`
}

type ErrApiRequest

type ErrApiRequest struct {
	Err error
}

func (*ErrApiRequest) Error

func (e *ErrApiRequest) Error() string

type ErrDomainExists

type ErrDomainExists struct {
	Domain string
	Err    error
}

func (*ErrDomainExists) Error

func (e *ErrDomainExists) Error() string

type ErrDomainIdNotFound

type ErrDomainIdNotFound struct {
	Id  int
	Err error
}

func (*ErrDomainIdNotFound) Error

func (e *ErrDomainIdNotFound) Error() string

type ErrDomainIdOrRecordIdNotFound

type ErrDomainIdOrRecordIdNotFound struct {
	DomainId int
	RecordId int
	Err      error
}

func (*ErrDomainIdOrRecordIdNotFound) Error

type ErrDomainIdPending

type ErrDomainIdPending struct {
	Id  int
	Err error
}

func (*ErrDomainIdPending) Error

func (e *ErrDomainIdPending) Error() string

type ErrDomainNotFound

type ErrDomainNotFound struct {
	Domain string
	Err    error
}

func (*ErrDomainNotFound) Error

func (e *ErrDomainNotFound) Error() string

type ErrFormat

type ErrFormat struct {
	Err error
}

func (*ErrFormat) Error

func (e *ErrFormat) Error() string

type ErrRecordExists

type ErrRecordExists struct {
	Type  string
	Name  string
	Value string
	Err   error
}

func (*ErrRecordExists) Error

func (e *ErrRecordExists) Error() string

type NameServers

type NameServers struct {
	Ipv6 string `json:"ipv6"`
	Ipv4 string `json:"ipv4"`
	Fqdn string `json:"fqdn"`
}

type NewDomain

type NewDomain struct {
	Name string `json:"name"`
}

type NewRecord

type NewRecord struct {
	Name        string `json:"name"`
	Type        string `json:"type"`
	Value       string `json:"value"`
	GtdLocation string `json:"gtdLocation"`
	Ttl         int    `json:"ttl"`
}

type Record

type Record struct {
	Source      int    `json:"source"`
	Ttl         int    `json:"ttl"`
	GtdLocation string `json:"gtdLocation"`
	SourceId    int    `json:"sourceId"`
	Failover    bool   `json:"failover"`
	Monitor     bool   `json:"monitor"`
	HardLink    bool   `json:"hardLink"`
	DynamicDns  bool   `json:"dynamicDns"`
	Failed      bool   `json:"failed"`
	Name        string `json:"name"`
	Value       string `json:"value"`
	Id          int    `json:"id"`
	Type        string `json:"type"`
}

type RecordsList

type RecordsList struct {
	TotalRecords int      `json:"totalRecords"`
	TotalPages   int      `json:"totalPages"`
	Data         []Record `json:"data"`
	Page         int      `json:"page"`
}

type Request

type Request struct {
	Method  string
	Path    string
	Queries map[string]string
	Body    []byte
}

type UpdateRecord

type UpdateRecord struct {
	Name        string `json:"name"`
	Type        string `json:"type"`
	Value       string `json:"value"`
	Id          int    `json:"id"`
	GtdLocation string `json:"gtdLocation"`
	Ttl         int    `json:"ttl"`
}

type VanityNameServers

type VanityNameServers struct {
	Fqdn string `json:"fqdn"`
}

Jump to

Keyboard shortcuts

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