email

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2016 License: BSD-3-Clause Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPattern = errors.New("invalid pattern")
)

Portable errors

Functions

This section is empty.

Types

type Options added in v0.3.0

type Options struct {
	Addr, Username, Password, FromAddr string
	Patterns                           []string
}

Options is used to construct a new UserService using the NewUserService function.

type UserService added in v0.3.0

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

UserService implements the UserService interface. Handles are interperted as email addresses.

func NewUserService added in v0.3.0

func NewUserService(opt *Options) (*UserService, error)

NewUserService returns a new UserService instance with the given options.

func (*UserService) AddPattern added in v0.3.0

func (s *UserService) AddPattern(pattern string) error

AddPattern adds the given pattern user accessible resources.

func (*UserService) Authorized added in v0.3.0

func (s *UserService) Authorized(handle, rawurl string) bool

Authorized returns true when a user identified with the given handle is authorized to access the resource at the given rawurl. Unknown resources are accessible to listed and unlisted user handlers.

func (*UserService) Close added in v0.3.0

func (s *UserService) Close() error

Close closes the channel to send mail messages.

func (*UserService) Listed added in v0.3.0

func (s *UserService) Listed(handle string) bool

Listed return true when the given address is listed.

func (*UserService) Notify added in v0.3.0

func (s *UserService) Notify(handle, loginurl string) error

Notify returns nil when the given login URL is succesfully sent to the given email address.

func (*UserService) Register added in v0.3.0

func (s *UserService) Register(handle string) error

Register returns nil when the given address is valid.

Jump to

Keyboard shortcuts

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