invites

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInviteCodeDisabled = errors.New("invite was disabled")

ErrInviteCodeDisabled is issued when the invite was disabled by another person

View Source
var ErrInviteCodeExpired = errors.New("invite token is expired")

ErrInviteCodeExpired is issued when the invite code has Expired.

Functions

func NewInvitesController

func NewInvitesController(s api.InvitesApiServicer) api.Router

NewInvitesController creates a default api controller

func NewInvitesService

func NewInvitesService(config Config, time stime.TimeService, repository Repository, notifications notifications.NotificationsService) (api.InvitesApiServicer, error)

NewInvitesService instantiates a new invitesService for interacting with Invites from outside of the package.

Types

type Config

type Config struct {
	Expiration time.Duration
	SendToHost string
	SendToPath string
}

Config holds the configuration for the Invites package

type Controller

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

A Controller binds http requests to an api service and writes the service results to the http response

func (*Controller) DeleteInvite

func (c *Controller) DeleteInvite(w http.ResponseWriter, r *http.Request)

DeleteInvite - Delete an invite that was sent and invalidate the token.

func (*Controller) ListInvites

func (c *Controller) ListInvites(w http.ResponseWriter, r *http.Request)

ListInvites - List outstanding invites

func (*Controller) Routes

func (c *Controller) Routes() api.Routes

Routes returns all of the api route for the InvitesApiController

func (*Controller) SendInvite

func (c *Controller) SendInvite(w http.ResponseWriter, r *http.Request)

SendInvite - Send an email invite to a new user

type Repository

type Repository interface {
	// contains filtered or unexported methods
}

Repository allows for interacting with the invites data store.

func NewInvitesRepository

func NewInvitesRepository(db *sql.DB) Repository

NewInvitesRepository instantiates a new InvitesRepository

Jump to

Keyboard shortcuts

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