Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // Authentication key ApiKey string // URL to the API to use URL string // HttpClient is the client to use. Default will be // used if not provided. Http *http.Client }
Client provides a client to the Mailgun API
func (*Client) CreateDomain ¶
func (c *Client) CreateDomain(opts *CreateDomain) (string, error)
CreateDomain creates a domain from the parameters specified and returns an error if it fails. If no error and the name is returned, the Domain was succesfully created.
func (*Client) DestroyDomain ¶
DestroyDomain destroys a domain by the ID specified and returns an error if it fails. If no error is returned, the Domain was succesfully destroyed.
func (*Client) NewRequest ¶
func (c *Client) NewRequest(params map[string]string, method string, endpoint string) (*http.Request, error)
Creates a new request with the params
func (*Client) RetrieveDomain ¶
func (c *Client) RetrieveDomain(name string) (DomainResponse, error)
RetrieveDomain gets a domain and records by the ID specified and returns a DomainResponse and an error. An error will be returned for failed requests with a nil DomainResponse.
type CreateDomain ¶
type CreateDomain struct { Name string // Name of the domain SmtpPassword string SpamAction string // one of disabled or tag Wildcard bool }
CreateDomain contains the request parameters to create a new domain.
type Domain ¶
type Domain struct { Name string `json:"name"` SmtpLogin string `json:"smtp_login"` SmtpPassword string `json:"smtp_password"` SpamAction string `json:"spam_action"` Wildcard bool `json:"wildcard"` }
Domain is used to represent a retrieved Domain. All properties are set as strings.
func (*Domain) StringWildcard ¶
type DomainResponse ¶
type DomainResponse struct { Domain Domain `json:"domain"` SendingRecords []SendingRecord `json:"sending_dns_records"` ReceivingRecords []ReceivingRecord `json:"receiving_dns_records"` }
type MailgunError ¶
type MailgunError struct {
Message string `json:"message"`
}
MailgunError is the error format that they return to us if there is a problem