Versions in this module Expand all Collapse all v0 v0.3.0 Aug 18, 2026 v0.2.0 Aug 6, 2026 Changes in this version + const DefaultRole + const MailKind + const PermWrite + const StatusExpired + const StatusPending + const StatusRedeemed + const StatusRevoked + const TokenBytes + var ErrNotRedeemable = errors.New("invite: this invitation cannot be redeemed") + type Config struct + AppURL string + Audit audit.Recorder + Hasher *auth.Hasher + Lockout auth.LockoutPolicy + Log *slog.Logger + Mail Enqueuer + NewAccounts bool + Notify notify.Notifier + TTL time.Duration + type CreateInput struct + Email string + Role string + type Created struct + Emailed bool + URL string + type Enqueuer interface + Enqueue func(ctx context.Context, to, kind string, data map[string]string) error + type Invitation struct + CreatedAt time.Time + Email string + ExpiresAt time.Time + ID uuid.UUID + InvitedBy string + RedeemedAt *time.Time + RevokedAt *time.Time + Role string + Status string + type Offer struct + ExpiresAt time.Time + OrganizationName string + Role string + type RedeemInput struct + Email string + Name string + Password string + Token string + type Redeemed struct + Created bool + Email string + OrganizationID uuid.UUID + OrganizationName string + Role string + UserID uuid.UUID + type Role struct + Description string + Name string + Rank int32 + Slug string + type Service struct + func NewService(pool *pgxpool.Pool, cfg Config) (*Service, error) + func (s *Service) AdmitsNewAccounts() bool + func (s *Service) Create(ctx context.Context, actor *auth.Identity, in CreateInput) (*Created, error) + func (s *Service) List(ctx context.Context, actor *auth.Identity) ([]Invitation, error) + func (s *Service) Offer(ctx context.Context, token string) (*Offer, error) + func (s *Service) Redeem(ctx context.Context, in RedeemInput) (*Redeemed, error) + func (s *Service) Revoke(ctx context.Context, actor *auth.Identity, id uuid.UUID) error + func (s *Service) Roles(ctx context.Context, actor *auth.Identity) ([]Role, error)