rpc

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2016 License: MIT Imports: 11 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

This section is empty.

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{}

Postmaster is just a holder for the RPC methods

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"`
}

SuccessResult holds just a Success bool and is used for methods that don't need to return anything

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