Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInviteCodeDisabled = errors.New("invite was disabled")
ErrInviteCodeDisabled is issued when the invite was disabled by another person
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 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