Documentation ¶
Index ¶
- Variables
- type Options
- type UserService
- func (s *UserService) AddPattern(pattern string) error
- func (s *UserService) Authorized(handle, rawurl string) bool
- func (s *UserService) Close() error
- func (s *UserService) Listed(handle string) bool
- func (s *UserService) Notify(handle, loginurl string) error
- func (s *UserService) Register(handle string) error
Constants ¶
This section is empty.
Variables ¶
var (
ErrInvalidPattern = errors.New("invalid pattern")
)
Portable errors
Functions ¶
This section is empty.
Types ¶
type Options ¶ added in v0.3.0
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.