rpc

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2015 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package rpc contains all the methods exposed to the rpc interface

Package rpc contains all the methods exposed to the rpc interface

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RPC

func RPC() http.Handler

RPC returns an http.Handler which will handle the RPC requests

Types

type GetLastEmailArgs added in v0.2.0

type GetLastEmailArgs struct {
	//this should match the validate for sender.Mail
	To       string `json:"to" validate:"email,nonzero,max=256"`
	UniqueID string `json:"uniqueID" validate:"nonzero,max=256"`
}

type GetLastEmailResult added in v0.2.0

type GetLastEmailResult struct {
	Stat *db.StatDoc `json:"stat"`
}

type Postmaster

type Postmaster struct{}

func (Postmaster) Enqueue

func (_ Postmaster) Enqueue(r *http.Request, args *sender.Mail, reply *SuccessResult) error

Enqueue queues an email to be sent to sendgrid it accepts an instance of sender.Mail

func (Postmaster) GetLastEmail added in v0.2.0

func (_ Postmaster) GetLastEmail(r *http.Request, args *GetLastEmailArgs, reply *GetLastEmailResult) error

GetLastEmail gets stats for the last email sent for a specific unique ID If no records were found, {"stat": null} is returned

func (Postmaster) UpdatePrefs

func (_ Postmaster) UpdatePrefs(r *http.Request, args *UpdatePrefsArgs, reply *SuccessResult) error

UpdatePrefs updates an email addresses email preferences

type SuccessResult added in v0.2.0

type SuccessResult struct {
	Success bool `json:"success"`
}

type UpdatePrefsArgs

type UpdatePrefsArgs struct {
	Email string `json:"email" validate:"email,nonzero"`
	Flags int64  `json:"flags" validate:"nonzero"`
}

Jump to

Keyboard shortcuts

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