invites

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: Apache-2.0 Imports: 21 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(logger logging.Logger, s InvitesService) api.Router

NewInvitesController creates a default api controller

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 InvitesService added in v0.2.4

type InvitesService interface {
	DisableInvite(tmw.TumblerClaims, string) error
	ListInvites(tmw.TumblerClaims) ([]client.Invite, error)
	SendInvite(tmw.TumblerClaims, client.SendInvite) (*client.Invite, string, error)
	Redeem(code string) (*client.Invite, error)
}

InvitesApiServicer defines the api actions for the InvitesApi service

func NewInvitesService

func NewInvitesService(config Config, time stime.TimeService, repository Repository, notifications notifications.NotificationsService, authnClient authnclient.AuthnClient, identity identities.Service) (InvitesService, error)

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

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