Documentation
¶
Index ¶
- Variables
- func BytesToIntArray(a []byte) []int
- type ApiKey
- type ApiKeysSvc
- type ApiKeysSvcImpl
- func (s *ApiKeysSvcImpl) Create(params *CreateApiKeyRequest) (CreateApiKeyResponse, error)
- func (s *ApiKeysSvcImpl) CreateWithContext(ctx context.Context, params *CreateApiKeyRequest) (CreateApiKeyResponse, error)
- func (s *ApiKeysSvcImpl) List() (ListApiKeysResponse, error)
- func (s *ApiKeysSvcImpl) ListWithContext(ctx context.Context) (ListApiKeysResponse, error)
- func (s *ApiKeysSvcImpl) Remove(apiKeyId string) (bool, error)
- func (s *ApiKeysSvcImpl) RemoveWithContext(ctx context.Context, apiKeyId string) (bool, error)
- type Attachment
- type Audience
- type AudiencesSvc
- type AudiencesSvcImpl
- func (s *AudiencesSvcImpl) Create(params *CreateAudienceRequest) (CreateAudienceResponse, error)
- func (s *AudiencesSvcImpl) CreateWithContext(ctx context.Context, params *CreateAudienceRequest) (CreateAudienceResponse, error)
- func (s *AudiencesSvcImpl) Get(audienceId string) (Audience, error)
- func (s *AudiencesSvcImpl) GetWithContext(ctx context.Context, audienceId string) (Audience, error)
- func (s *AudiencesSvcImpl) List() (ListAudiencesResponse, error)
- func (s *AudiencesSvcImpl) ListWithContext(ctx context.Context) (ListAudiencesResponse, error)
- func (s *AudiencesSvcImpl) Remove(audienceId string) (RemoveAudienceResponse, error)
- func (s *AudiencesSvcImpl) RemoveWithContext(ctx context.Context, audienceId string) (RemoveAudienceResponse, error)
- type BatchEmailResponse
- type BatchSvc
- type BatchSvcImpl
- type Broadcast
- type BroadcastsSvc
- type BroadcastsSvcImpl
- func (s *BroadcastsSvcImpl) Create(params *CreateBroadcastRequest) (CreateBroadcastResponse, error)
- func (s *BroadcastsSvcImpl) CreateWithContext(ctx context.Context, params *CreateBroadcastRequest) (CreateBroadcastResponse, error)
- func (s *BroadcastsSvcImpl) Get(broadcastId string) (Broadcast, error)
- func (s *BroadcastsSvcImpl) GetWithContext(ctx context.Context, broadcastId string) (Broadcast, error)
- func (s *BroadcastsSvcImpl) List() (ListBroadcastsResponse, error)
- func (s *BroadcastsSvcImpl) ListWithContext(ctx context.Context) (ListBroadcastsResponse, error)
- func (s *BroadcastsSvcImpl) Remove(broadcastId string) (RemoveBroadcastResponse, error)
- func (s *BroadcastsSvcImpl) RemoveWithContext(ctx context.Context, broadcastId string) (RemoveBroadcastResponse, error)
- func (s *BroadcastsSvcImpl) Send(params *SendBroadcastRequest) (SendBroadcastResponse, error)
- func (s *BroadcastsSvcImpl) SendWithContext(ctx context.Context, params *SendBroadcastRequest) (SendBroadcastResponse, error)
- type CancelScheduledEmailResponse
- type Client
- type Contact
- type ContactsSvc
- type ContactsSvcImpl
- func (s *ContactsSvcImpl) Create(params *CreateContactRequest) (CreateContactResponse, error)
- func (s *ContactsSvcImpl) CreateWithContext(ctx context.Context, params *CreateContactRequest) (CreateContactResponse, error)
- func (s *ContactsSvcImpl) Get(audienceId, contactId string) (Contact, error)
- func (s *ContactsSvcImpl) GetWithContext(ctx context.Context, audienceId, contactId string) (Contact, error)
- func (s *ContactsSvcImpl) List(audienceId string) (ListContactsResponse, error)
- func (s *ContactsSvcImpl) ListWithContext(ctx context.Context, audienceId string) (ListContactsResponse, error)
- func (s *ContactsSvcImpl) Remove(audienceId, contactId string) (RemoveContactResponse, error)
- func (s *ContactsSvcImpl) RemoveWithContext(ctx context.Context, audienceId, contactId string) (RemoveContactResponse, error)
- func (s *ContactsSvcImpl) Update(params *UpdateContactRequest) (UpdateContactResponse, error)
- func (s *ContactsSvcImpl) UpdateWithContext(ctx context.Context, params *UpdateContactRequest) (UpdateContactResponse, error)
- type CreateApiKeyRequest
- type CreateApiKeyResponse
- type CreateAudienceRequest
- type CreateAudienceResponse
- type CreateBroadcastRequest
- type CreateBroadcastResponse
- type CreateContactRequest
- type CreateContactResponse
- type CreateDomainRequest
- type CreateDomainResponse
- type DefaultError
- type Domain
- type DomainsSvc
- type DomainsSvcImpl
- func (s *DomainsSvcImpl) Create(params *CreateDomainRequest) (CreateDomainResponse, error)
- func (s *DomainsSvcImpl) CreateWithContext(ctx context.Context, params *CreateDomainRequest) (CreateDomainResponse, error)
- func (s *DomainsSvcImpl) Get(domainId string) (Domain, error)
- func (s *DomainsSvcImpl) GetWithContext(ctx context.Context, domainId string) (Domain, error)
- func (s *DomainsSvcImpl) List() (ListDomainsResponse, error)
- func (s *DomainsSvcImpl) ListWithContext(ctx context.Context) (ListDomainsResponse, error)
- func (s *DomainsSvcImpl) Remove(domainId string) (bool, error)
- func (s *DomainsSvcImpl) RemoveWithContext(ctx context.Context, domainId string) (bool, error)
- func (s *DomainsSvcImpl) Update(domainId string, params *UpdateDomainRequest) (Domain, error)
- func (s *DomainsSvcImpl) UpdateWithContext(ctx context.Context, domainId string, params *UpdateDomainRequest) (Domain, error)
- func (s *DomainsSvcImpl) Verify(domainId string) (bool, error)
- func (s *DomainsSvcImpl) VerifyWithContext(ctx context.Context, domainId string) (bool, error)
- type Email
- type EmailsSvc
- type EmailsSvcImpl
- func (s *EmailsSvcImpl) Cancel(emailID string) (*CancelScheduledEmailResponse, error)
- func (s *EmailsSvcImpl) CancelWithContext(ctx context.Context, emailID string) (*CancelScheduledEmailResponse, error)
- func (s *EmailsSvcImpl) Get(emailID string) (*Email, error)
- func (s *EmailsSvcImpl) GetWithContext(ctx context.Context, emailID string) (*Email, error)
- func (s *EmailsSvcImpl) Send(params *SendEmailRequest) (*SendEmailResponse, error)
- func (s *EmailsSvcImpl) SendWithContext(ctx context.Context, params *SendEmailRequest) (*SendEmailResponse, error)
- func (s *EmailsSvcImpl) Update(params *UpdateEmailRequest) (*UpdateEmailResponse, error)
- func (s *EmailsSvcImpl) UpdateWithContext(ctx context.Context, params *UpdateEmailRequest) (*UpdateEmailResponse, error)
- type InvalidRequestError
- type ListApiKeysResponse
- type ListAudiencesResponse
- type ListBroadcastsResponse
- type ListContactsResponse
- type ListDomainsResponse
- type MissingRequiredFieldsError
- type Record
- type RemoveAudienceResponse
- type RemoveBroadcastResponse
- type RemoveContactResponse
- type SendBroadcastRequest
- type SendBroadcastResponse
- type SendEmailRequest
- type SendEmailResponse
- type Tag
- type TlsOption
- type UpdateContactRequest
- type UpdateContactResponse
- type UpdateDomainRequest
- type UpdateEmailRequest
- type UpdateEmailResponse
Constants ¶
This section is empty.
Variables ¶
var ( ErrFailedToCreateBroadcastSendRequest = errors.New("[ERROR]: Failed to create Broadcasts.Send request") ErrFailedToCreateBroadcastCreateRequest = errors.New("[ERROR]: Failed to create Broadcasts.Create request") )
BroadcastsSvc errors
var ( ErrFailedToCreateApiKeysCreateRequest = errors.New("[ERROR]: Failed to create ApiKeys.Create request") ErrFailedToCreateApiKeysListRequest = errors.New("[ERROR]: Failed to create ApiKeys.List request") ErrFailedToCreateApiKeysRemoveRequest = errors.New("[ERROR]: Failed to create ApiKeys.Remove request") )
ApiKeySvc errors
var ( ErrFailedToCreateUpdateEmailRequest = errors.New("[ERROR]: Failed to create UpdateEmail request") ErrFailedToCreateEmailsSendRequest = errors.New("[ERROR]: Failed to create SendEmail request") ErrFailedToCreateEmailsGetRequest = errors.New("[ERROR]: Failed to create GetEmail request") )
EmailsSvc errors
Functions ¶
func BytesToIntArray ¶
BytesToIntArray converts a byte array to rune array ie: []byte(`hello`) becomes []int{104,101,108,108,111} which will then be properly marshalled into JSON in the way Resend supports
Types ¶
type ApiKeysSvc ¶
type ApiKeysSvc interface { CreateWithContext(ctx context.Context, params *CreateApiKeyRequest) (CreateApiKeyResponse, error) Create(params *CreateApiKeyRequest) (CreateApiKeyResponse, error) ListWithContext(ctx context.Context) (ListApiKeysResponse, error) List() (ListApiKeysResponse, error) RemoveWithContext(ctx context.Context, apiKeyId string) (bool, error) Remove(apiKeyId string) (bool, error) }
type ApiKeysSvcImpl ¶
type ApiKeysSvcImpl struct {
// contains filtered or unexported fields
}
func (*ApiKeysSvcImpl) Create ¶
func (s *ApiKeysSvcImpl) Create(params *CreateApiKeyRequest) (CreateApiKeyResponse, error)
Create creates a new API Key based on the given params
func (*ApiKeysSvcImpl) CreateWithContext ¶
func (s *ApiKeysSvcImpl) CreateWithContext(ctx context.Context, params *CreateApiKeyRequest) (CreateApiKeyResponse, error)
CreateWithContext creates a new API Key based on the given params https://resend.com/docs/api-reference/api-keys/create-api-key
func (*ApiKeysSvcImpl) List ¶
func (s *ApiKeysSvcImpl) List() (ListApiKeysResponse, error)
List all API Keys in the project
func (*ApiKeysSvcImpl) ListWithContext ¶
func (s *ApiKeysSvcImpl) ListWithContext(ctx context.Context) (ListApiKeysResponse, error)
ListWithContext list all API Keys in the project https://resend.com/docs/api-reference/api-keys/list-api-keys
func (*ApiKeysSvcImpl) Remove ¶
func (s *ApiKeysSvcImpl) Remove(apiKeyId string) (bool, error)
Remove deletes a given api key by id
func (*ApiKeysSvcImpl) RemoveWithContext ¶
RemoveWithContext deletes a given api key by id https://resend.com/docs/api-reference/api-keys/delete-api-key
type Attachment ¶
type Attachment struct { // Content is the binary content of the attachment to use when a Path // is not available. Content []byte // Filename that will appear in the email. // Make sure you pick the correct extension otherwise preview // may not work as expected Filename string // Path where the attachment file is hosted instead of providing the // content directly. Path string // Content type for the attachment, if not set will be derived from // the filename property ContentType string }
Attachment is the public struct used for adding attachments to emails
func (*Attachment) MarshalJSON ¶
func (a *Attachment) MarshalJSON() ([]byte, error)
MarshalJSON overrides the regular JSON Marshaller to ensure that the attachment content is provided in the way Resend expects.
type AudiencesSvc ¶ added in v2.4.0
type AudiencesSvc interface { CreateWithContext(ctx context.Context, params *CreateAudienceRequest) (CreateAudienceResponse, error) Create(params *CreateAudienceRequest) (CreateAudienceResponse, error) ListWithContext(ctx context.Context) (ListAudiencesResponse, error) List() (ListAudiencesResponse, error) GetWithContext(ctx context.Context, audienceId string) (Audience, error) Get(audienceId string) (Audience, error) RemoveWithContext(ctx context.Context, audienceId string) (RemoveAudienceResponse, error) Remove(audienceId string) (RemoveAudienceResponse, error) }
type AudiencesSvcImpl ¶ added in v2.4.0
type AudiencesSvcImpl struct {
// contains filtered or unexported fields
}
func (*AudiencesSvcImpl) Create ¶ added in v2.4.0
func (s *AudiencesSvcImpl) Create(params *CreateAudienceRequest) (CreateAudienceResponse, error)
Create creates a new Audience entry based on the given params https://resend.com/docs/api-reference/audiences/create-audience
func (*AudiencesSvcImpl) CreateWithContext ¶ added in v2.4.0
func (s *AudiencesSvcImpl) CreateWithContext(ctx context.Context, params *CreateAudienceRequest) (CreateAudienceResponse, error)
CreateWithContext creates a new Audience entry based on the given params https://resend.com/docs/api-reference/audiences/create-audience
func (*AudiencesSvcImpl) Get ¶ added in v2.4.0
func (s *AudiencesSvcImpl) Get(audienceId string) (Audience, error)
Get Retrieve a single audience. https://resend.com/docs/api-reference/audiences/get-audience
func (*AudiencesSvcImpl) GetWithContext ¶ added in v2.4.0
GetWithContext Retrieve a single audience. https://resend.com/docs/api-reference/audiences/get-audience
func (*AudiencesSvcImpl) List ¶ added in v2.4.0
func (s *AudiencesSvcImpl) List() (ListAudiencesResponse, error)
List returns the list of all audiences https://resend.com/docs/api-reference/audiences/list-audiences
func (*AudiencesSvcImpl) ListWithContext ¶ added in v2.4.0
func (s *AudiencesSvcImpl) ListWithContext(ctx context.Context) (ListAudiencesResponse, error)
ListWithContext returns the list of all audiences https://resend.com/docs/api-reference/audiences/list-audiences
func (*AudiencesSvcImpl) Remove ¶ added in v2.4.0
func (s *AudiencesSvcImpl) Remove(audienceId string) (RemoveAudienceResponse, error)
Remove removes a given audience entry by id https://resend.com/docs/api-reference/audiences/delete-audience
func (*AudiencesSvcImpl) RemoveWithContext ¶ added in v2.4.0
func (s *AudiencesSvcImpl) RemoveWithContext(ctx context.Context, audienceId string) (RemoveAudienceResponse, error)
RemoveWithContext removes a given audience by id https://resend.com/docs/api-reference/audiences/delete-audience
type BatchEmailResponse ¶
type BatchEmailResponse struct {
Data []SendEmailResponse `json:"data"`
}
BatchEmailResponse is the response from the BatchSendEmail call. see https://resend.com/docs/api-reference/emails/send-batch-emails
type BatchSvc ¶
type BatchSvc interface { Send([]*SendEmailRequest) (*BatchEmailResponse, error) SendWithContext(ctx context.Context, params []*SendEmailRequest) (*BatchEmailResponse, error) }
type BatchSvcImpl ¶
type BatchSvcImpl struct {
// contains filtered or unexported fields
}
func (*BatchSvcImpl) Send ¶
func (s *BatchSvcImpl) Send(params []*SendEmailRequest) (*BatchEmailResponse, error)
Send send a batch of emails https://resend.com/docs/api-reference/emails/send-batch-emails
func (*BatchSvcImpl) SendWithContext ¶
func (s *BatchSvcImpl) SendWithContext(ctx context.Context, params []*SendEmailRequest) (*BatchEmailResponse, error)
SendWithContext is the same as Send but accepts a ctx as argument
type Broadcast ¶ added in v2.14.0
type Broadcast struct { Object string `json:"object"` Id string `json:"id"` Name string `json:"name"` AudienceId string `json:"audience_id"` From string `json:"from"` Subject string `json:"subject"` ReplyTo []string `json:"reply_to"` PreviewText string `json:"preview_text"` Status string `json:"status"` CreatedAt string `json:"created_at"` ScheduledAt string `json:"scheduled_at"` SentAt string `json:"sent_at"` }
type BroadcastsSvc ¶ added in v2.14.0
type BroadcastsSvc interface { CreateWithContext(ctx context.Context, params *CreateBroadcastRequest) (CreateBroadcastResponse, error) Create(params *CreateBroadcastRequest) (CreateBroadcastResponse, error) ListWithContext(ctx context.Context) (ListBroadcastsResponse, error) List() (ListBroadcastsResponse, error) GetWithContext(ctx context.Context, broadcastId string) (Broadcast, error) Get(broadcastId string) (Broadcast, error) SendWithContext(ctx context.Context, params *SendBroadcastRequest) (SendBroadcastResponse, error) Send(params *SendBroadcastRequest) (SendBroadcastResponse, error) RemoveWithContext(ctx context.Context, broadcastId string) (RemoveBroadcastResponse, error) Remove(broadcastId string) (RemoveBroadcastResponse, error) }
type BroadcastsSvcImpl ¶ added in v2.14.0
type BroadcastsSvcImpl struct {
// contains filtered or unexported fields
}
func (*BroadcastsSvcImpl) Create ¶ added in v2.14.0
func (s *BroadcastsSvcImpl) Create(params *CreateBroadcastRequest) (CreateBroadcastResponse, error)
Create creates a new Broadcast based on the given params
func (*BroadcastsSvcImpl) CreateWithContext ¶ added in v2.14.0
func (s *BroadcastsSvcImpl) CreateWithContext(ctx context.Context, params *CreateBroadcastRequest) (CreateBroadcastResponse, error)
CreateWithContext creates a new Broadcast based on the given params https://resend.com/docs/api-reference/broadcasts/create-broadcast
func (*BroadcastsSvcImpl) Get ¶ added in v2.14.0
func (s *BroadcastsSvcImpl) Get(broadcastId string) (Broadcast, error)
Get retrieves a single broadcast.
func (*BroadcastsSvcImpl) GetWithContext ¶ added in v2.14.0
func (s *BroadcastsSvcImpl) GetWithContext(ctx context.Context, broadcastId string) (Broadcast, error)
GetWithContext Retrieve a single broadcast. https://resend.com/docs/api-reference/broadcasts/get-broadcast
func (*BroadcastsSvcImpl) List ¶ added in v2.14.0
func (s *BroadcastsSvcImpl) List() (ListBroadcastsResponse, error)
List returns the list of all broadcasts
func (*BroadcastsSvcImpl) ListWithContext ¶ added in v2.14.0
func (s *BroadcastsSvcImpl) ListWithContext(ctx context.Context) (ListBroadcastsResponse, error)
ListWithContext returns the list of all broadcasts https://resend.com/docs/api-reference/broadcasts/list-broadcasts
func (*BroadcastsSvcImpl) Remove ¶ added in v2.14.0
func (s *BroadcastsSvcImpl) Remove(broadcastId string) (RemoveBroadcastResponse, error)
Remove removes a given broadcast entry by id
func (*BroadcastsSvcImpl) RemoveWithContext ¶ added in v2.14.0
func (s *BroadcastsSvcImpl) RemoveWithContext(ctx context.Context, broadcastId string) (RemoveBroadcastResponse, error)
RemoveWithContext removes a given broadcast by id https://resend.com/docs/api-reference/broadcasts/delete-broadcast
func (*BroadcastsSvcImpl) Send ¶ added in v2.14.0
func (s *BroadcastsSvcImpl) Send(params *SendBroadcastRequest) (SendBroadcastResponse, error)
Send sends broadcasts to your audience.
func (*BroadcastsSvcImpl) SendWithContext ¶ added in v2.14.0
func (s *BroadcastsSvcImpl) SendWithContext(ctx context.Context, params *SendBroadcastRequest) (SendBroadcastResponse, error)
SendWithContext Sends broadcasts to your audience. https://resend.com/docs/api-reference/broadcasts/send-broadcast
type CancelScheduledEmailResponse ¶ added in v2.11.0
CancelScheduledEmailResponse is the response from the Cancel call.
type Client ¶
type Client struct { // Api Key ApiKey string // Base URL BaseURL *url.URL // User agent for client UserAgent string // Services Emails EmailsSvc Batch BatchSvc ApiKeys ApiKeysSvc Domains DomainsSvc Audiences AudiencesSvc Contacts ContactsSvc Broadcasts BroadcastsSvc // contains filtered or unexported fields }
Client handles communication with Resend API.
func NewCustomClient ¶
NewCustomClient builds a new Resend API client, using a provided Http client.
type ContactsSvc ¶ added in v2.4.0
type ContactsSvc interface { CreateWithContext(ctx context.Context, params *CreateContactRequest) (CreateContactResponse, error) Create(params *CreateContactRequest) (CreateContactResponse, error) ListWithContext(ctx context.Context, audienceId string) (ListContactsResponse, error) List(audienceId string) (ListContactsResponse, error) GetWithContext(ctx context.Context, audienceId, contactId string) (Contact, error) Get(audienceId, contactId string) (Contact, error) RemoveWithContext(ctx context.Context, audienceId, contactId string) (RemoveContactResponse, error) Remove(audienceId, contactId string) (RemoveContactResponse, error) UpdateWithContext(ctx context.Context, params *UpdateContactRequest) (UpdateContactResponse, error) Update(params *UpdateContactRequest) (UpdateContactResponse, error) }
type ContactsSvcImpl ¶ added in v2.4.0
type ContactsSvcImpl struct {
// contains filtered or unexported fields
}
func (*ContactsSvcImpl) Create ¶ added in v2.4.0
func (s *ContactsSvcImpl) Create(params *CreateContactRequest) (CreateContactResponse, error)
Create creates a new Contact entry based on the given params https://resend.com/docs/api-reference/contacts/create-contact
func (*ContactsSvcImpl) CreateWithContext ¶ added in v2.4.0
func (s *ContactsSvcImpl) CreateWithContext(ctx context.Context, params *CreateContactRequest) (CreateContactResponse, error)
CreateWithContext creates a new Contact based on the given params https://resend.com/docs/api-reference/contacts/create-contact
func (*ContactsSvcImpl) Get ¶ added in v2.4.0
func (s *ContactsSvcImpl) Get(audienceId, contactId string) (Contact, error)
Get Retrieve a single contact. https://resend.com/docs/api-reference/contacts/get-contact
func (*ContactsSvcImpl) GetWithContext ¶ added in v2.4.0
func (s *ContactsSvcImpl) GetWithContext(ctx context.Context, audienceId, contactId string) (Contact, error)
GetWithContext Retrieve a single contact. https://resend.com/docs/api-reference/contacts/get-contact
func (*ContactsSvcImpl) List ¶ added in v2.4.0
func (s *ContactsSvcImpl) List(audienceId string) (ListContactsResponse, error)
List returns the list of all contacts in an audience https://resend.com/docs/api-reference/contacts/list-contacts
func (*ContactsSvcImpl) ListWithContext ¶ added in v2.4.0
func (s *ContactsSvcImpl) ListWithContext(ctx context.Context, audienceId string) (ListContactsResponse, error)
ListWithContext returns the list of all contacts in an audience https://resend.com/docs/api-reference/contacts/list-contacts
func (*ContactsSvcImpl) Remove ¶ added in v2.4.0
func (s *ContactsSvcImpl) Remove(audienceId, contactId string) (RemoveContactResponse, error)
Remove removes a given contact entry by id or email
@param [contactId] - the contact id or contact email
https://resend.com/docs/api-reference/contacts/delete-contact
func (*ContactsSvcImpl) RemoveWithContext ¶ added in v2.4.0
func (s *ContactsSvcImpl) RemoveWithContext(ctx context.Context, audienceId, contactId string) (RemoveContactResponse, error)
RemoveWithContext same as Remove but with context https://resend.com/docs/api-reference/contacts/delete-contact
func (*ContactsSvcImpl) Update ¶ added in v2.4.0
func (s *ContactsSvcImpl) Update(params *UpdateContactRequest) (UpdateContactResponse, error)
UpdateWithContext updates an existing Contact based on the given params https://resend.com/docs/api-reference/contacts/update-contact
func (*ContactsSvcImpl) UpdateWithContext ¶ added in v2.4.0
func (s *ContactsSvcImpl) UpdateWithContext(ctx context.Context, params *UpdateContactRequest) (UpdateContactResponse, error)
UpdateWithContext updates an existing Contact based on the given params https://resend.com/docs/api-reference/contacts/update-contact
type CreateApiKeyRequest ¶
type CreateApiKeyResponse ¶
type CreateAudienceRequest ¶ added in v2.4.0
type CreateAudienceRequest struct {
Name string `json:"name"`
}
type CreateAudienceResponse ¶ added in v2.4.0
type CreateBroadcastRequest ¶ added in v2.14.0
type CreateBroadcastResponse ¶ added in v2.14.0
type CreateBroadcastResponse struct {
Id string `json:"id"`
}
type CreateContactRequest ¶ added in v2.4.0
type CreateContactResponse ¶ added in v2.4.0
type CreateDomainRequest ¶
type CreateDomainResponse ¶
type DefaultError ¶
type DefaultError struct {
Message string `json:"message"`
}
type DomainsSvc ¶
type DomainsSvc interface { CreateWithContext(ctx context.Context, params *CreateDomainRequest) (CreateDomainResponse, error) Create(params *CreateDomainRequest) (CreateDomainResponse, error) VerifyWithContext(ctx context.Context, domainId string) (bool, error) Verify(domainId string) (bool, error) ListWithContext(ctx context.Context) (ListDomainsResponse, error) List() (ListDomainsResponse, error) GetWithContext(ctx context.Context, domainId string) (Domain, error) Get(domainId string) (Domain, error) RemoveWithContext(ctx context.Context, domainId string) (bool, error) Remove(domainId string) (bool, error) UpdateWithContext(ctx context.Context, domainId string, params *UpdateDomainRequest) (Domain, error) Update(domainId string, params *UpdateDomainRequest) (Domain, error) }
type DomainsSvcImpl ¶
type DomainsSvcImpl struct {
// contains filtered or unexported fields
}
func (*DomainsSvcImpl) Create ¶
func (s *DomainsSvcImpl) Create(params *CreateDomainRequest) (CreateDomainResponse, error)
Create creates a new Domain entry based on the given params https://resend.com/docs/api-reference/domains/create-domain
func (*DomainsSvcImpl) CreateWithContext ¶
func (s *DomainsSvcImpl) CreateWithContext(ctx context.Context, params *CreateDomainRequest) (CreateDomainResponse, error)
CreateWithContext creates a new Domain entry based on the given params https://resend.com/docs/api-reference/domains/create-domain
func (*DomainsSvcImpl) Get ¶
func (s *DomainsSvcImpl) Get(domainId string) (Domain, error)
Get retrieves a domain object https://resend.com/docs/api-reference/domains/get-domain
func (*DomainsSvcImpl) GetWithContext ¶
GetWithContext retrieves a domain object https://resend.com/docs/api-reference/domains/get-domain
func (*DomainsSvcImpl) List ¶
func (s *DomainsSvcImpl) List() (ListDomainsResponse, error)
List returns the list of all domains https://resend.com/docs/api-reference/domains/list-domains
func (*DomainsSvcImpl) ListWithContext ¶
func (s *DomainsSvcImpl) ListWithContext(ctx context.Context) (ListDomainsResponse, error)
ListWithContext returns the list of all domains https://resend.com/docs/api-reference/domains/list-domains
func (*DomainsSvcImpl) Remove ¶
func (s *DomainsSvcImpl) Remove(domainId string) (bool, error)
Remove removes a given domain entry by id https://resend.com/docs/api-reference/domains/delete-domain
func (*DomainsSvcImpl) RemoveWithContext ¶
RemoveWithContext removes a given domain entry by id https://resend.com/docs/api-reference/domains/delete-domain
func (*DomainsSvcImpl) Update ¶ added in v2.6.0
func (s *DomainsSvcImpl) Update(domainId string, params *UpdateDomainRequest) (Domain, error)
Update is a wrapper around UpdateWithContext
func (*DomainsSvcImpl) UpdateWithContext ¶ added in v2.6.0
func (s *DomainsSvcImpl) UpdateWithContext(ctx context.Context, domainId string, params *UpdateDomainRequest) (Domain, error)
UpdateWithContext updates an existing Domain entry based on the given params https://resend.com/docs/api-reference/domains/update-domain
func (*DomainsSvcImpl) Verify ¶
func (s *DomainsSvcImpl) Verify(domainId string) (bool, error)
Verify verifies a given domain Id https://resend.com/docs/api-reference/domains/verify-domain
func (*DomainsSvcImpl) VerifyWithContext ¶
VerifyWithContext verifies a given domain Id https://resend.com/docs/api-reference/domains/verify-domain
type Email ¶
type Email struct { Id string `json:"id"` Object string `json:"object"` To []string `json:"to"` From string `json:"from"` CreatedAt string `json:"created_at"` Subject string `json:"subject"` Html string `json:"html"` Text string `json:"text"` Bcc []string `json:"bcc"` Cc []string `json:"cc"` ReplyTo []string `json:"reply_to"` LastEvent string `json:"last_event"` }
Email provides the structure for the response from the Get call.
type EmailsSvc ¶
type EmailsSvc interface { CancelWithContext(ctx context.Context, emailID string) (*CancelScheduledEmailResponse, error) Cancel(emailID string) (*CancelScheduledEmailResponse, error) UpdateWithContext(ctx context.Context, params *UpdateEmailRequest) (*UpdateEmailResponse, error) Update(params *UpdateEmailRequest) (*UpdateEmailResponse, error) SendWithContext(ctx context.Context, params *SendEmailRequest) (*SendEmailResponse, error) Send(params *SendEmailRequest) (*SendEmailResponse, error) GetWithContext(ctx context.Context, emailID string) (*Email, error) Get(emailID string) (*Email, error) }
type EmailsSvcImpl ¶
type EmailsSvcImpl struct {
// contains filtered or unexported fields
}
func (*EmailsSvcImpl) Cancel ¶ added in v2.11.0
func (s *EmailsSvcImpl) Cancel(emailID string) (*CancelScheduledEmailResponse, error)
Cancel cancels an email by ID https://resend.com/docs/api-reference/emails/cancel-email
func (*EmailsSvcImpl) CancelWithContext ¶ added in v2.11.0
func (s *EmailsSvcImpl) CancelWithContext(ctx context.Context, emailID string) (*CancelScheduledEmailResponse, error)
CancelWithContext cancels an email by ID https://resend.com/docs/api-reference/emails/cancel-email
func (*EmailsSvcImpl) Get ¶
func (s *EmailsSvcImpl) Get(emailID string) (*Email, error)
Get retrieves an email with the given emailID https://resend.com/docs/api-reference/emails/retrieve-email
func (*EmailsSvcImpl) GetWithContext ¶
GetWithContext retrieves an email with the given emailID https://resend.com/docs/api-reference/emails/retrieve-email
func (*EmailsSvcImpl) Send ¶
func (s *EmailsSvcImpl) Send(params *SendEmailRequest) (*SendEmailResponse, error)
Send sends an email with the given params https://resend.com/docs/api-reference/emails/send-email
func (*EmailsSvcImpl) SendWithContext ¶
func (s *EmailsSvcImpl) SendWithContext(ctx context.Context, params *SendEmailRequest) (*SendEmailResponse, error)
SendWithContext sends an email with the given params https://resend.com/docs/api-reference/emails/send-email
func (*EmailsSvcImpl) Update ¶ added in v2.11.0
func (s *EmailsSvcImpl) Update(params *UpdateEmailRequest) (*UpdateEmailResponse, error)
Update updates an email with the given params https://resend.com/docs/api-reference/emails/update-email
func (*EmailsSvcImpl) UpdateWithContext ¶ added in v2.11.0
func (s *EmailsSvcImpl) UpdateWithContext(ctx context.Context, params *UpdateEmailRequest) (*UpdateEmailResponse, error)
UpdateWithContext updates an email with the given params https://resend.com/docs/api-reference/emails/update-email
type InvalidRequestError ¶
type ListApiKeysResponse ¶
type ListApiKeysResponse struct {
Data []ApiKey `json:"data"`
}
type ListAudiencesResponse ¶ added in v2.4.0
type ListBroadcastsResponse ¶ added in v2.14.0
type ListContactsResponse ¶ added in v2.4.0
type ListDomainsResponse ¶
type ListDomainsResponse struct {
Data []Domain `json:"data"`
}
type MissingRequiredFieldsError ¶ added in v2.15.0
type MissingRequiredFieldsError struct {
// contains filtered or unexported fields
}
MissingRequiredFieldsError is used when a required field is missing before making an API request
func (*MissingRequiredFieldsError) Error ¶ added in v2.15.0
func (e *MissingRequiredFieldsError) Error() string
type RemoveAudienceResponse ¶ added in v2.4.0
type RemoveBroadcastResponse ¶ added in v2.14.0
type RemoveContactResponse ¶ added in v2.4.0
type SendBroadcastRequest ¶ added in v2.14.0
type SendBroadcastResponse ¶ added in v2.14.0
type SendBroadcastResponse struct {
Id string `json:"id"`
}
type SendEmailRequest ¶
type SendEmailRequest struct { From string `json:"from"` To []string `json:"to"` Subject string `json:"subject"` Bcc []string `json:"bcc,omitempty"` Cc []string `json:"cc,omitempty"` ReplyTo string `json:"reply_to,omitempty"` Html string `json:"html,omitempty"` Text string `json:"text,omitempty"` Tags []Tag `json:"tags,omitempty"` Attachments []*Attachment `json:"attachments,omitempty"` Headers map[string]string `json:"headers,omitempty"` ScheduledAt string `json:"scheduled_at,omitempty"` }
SendEmailRequest is the request object for the Send call.
See also https://resend.com/docs/api-reference/emails/send-email
type SendEmailResponse ¶
type SendEmailResponse struct {
Id string `json:"id"`
}
SendEmailResponse is the response from the Send call.
type UpdateContactRequest ¶ added in v2.4.0
type UpdateContactResponse ¶ added in v2.4.0
type UpdateContactResponse struct { Data Contact `json:"data"` Error struct{} `json:"error"` // Fix this }
type UpdateDomainRequest ¶ added in v2.6.0
type UpdateEmailRequest ¶ added in v2.11.0
UpdateEmailRequest is the request object for the Update call.
type UpdateEmailResponse ¶ added in v2.11.0
UpdateEmailResponse is the type that represents the response from the Update call.