sendcloud

package module
v0.0.0-...-834cb0f Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2014 License: MIT Imports: 14 Imported by: 0

README

# go-sendcloud

Sendcloud client in Go. API doc http://godoc.org/github.com/riobard/go-sendcloud

Documentation

Overview

Sendcloud client in Go.

Index

Constants

View Source
const (
	API_ENDPOINT = "https://sendcloud.sohu.com/webapi/"
)

Variables

View Source
var (
	ErrMethodNotAllowed = fmt.Errorf("method not allowed")
	ErrBadSignature     = fmt.Errorf("bad signature")
	ErrInvalidTimestamp = fmt.Errorf("invalid timestamp")
	ErrInvalidForm      = fmt.Errorf("invalid form data")
)
View Source
var EMAIL_DOMAIN_RE = regexp.MustCompile(`[^<>]+<?.+@([^<>]+)>?`)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New() *Client

func (*Client) AddDomain

func (c *Client) AddDomain(domain, api_user, api_key string)

add a sending domain with its authentication info

func (*Client) Send

func (c *Client) Send(m Mail) (id string, err error)

type Event

type Event struct {
	// contains filtered or unexported fields
}

func (*Event) MsgId

func (e *Event) MsgId() string

func (*Event) Name

func (e *Event) Name() string

func (*Event) Rcpt

func (e *Event) Rcpt() string

func (*Event) Reason

func (e *Event) Reason() string

func (*Event) Time

func (e *Event) Time() time.Time

type Mail

type Mail interface {
	From() string // mail-from address
	To() []string
	Cc() []string
	Bcc() []string
	ReplyTo() string // reply-to address
	Subject() string
	Html() string               // HTML mail body
	Headers() map[string]string // extra mail headers
}

type Webhook

type Webhook struct {
	// contains filtered or unexported fields
}

func NewWebhook

func NewWebhook(key string) *Webhook

func (*Webhook) Handle

func (wh *Webhook) Handle(w http.ResponseWriter, req *http.Request) (evt *Event, err error)

func (*Webhook) Verify

func (wh *Webhook) Verify(timestamp, token, signature string) bool

Jump to

Keyboard shortcuts

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