Versions in this module Expand all Collapse all v0 v0.10.0 Sep 6, 2026 Changes in this version + const DefaultInviteExpiry + type API struct + func NewAPI(service Service, orgSvc organization.Service, config APIConfig) *API + func (a *API) Router() chi.Router + func (a *API) ServeHTTP(w http.ResponseWriter, r *http.Request) + type APIConfig struct + BasePath string + Logger *slog.Logger + func DefaultAPIConfig() APIConfig + type AcceptInviteInput struct + PrincipalID uuid.UUID + Token string + type AcceptInviteRequest struct + Body struct{ ... } + Token string + type AcceptInviteResponse struct + Body *InviteResponse + type CreateInviteInput struct + Email string + ExpiresIn time.Duration + InviterPrincipalID uuid.UUID + Message *string + OrganizationID uuid.UUID + Role string + type CreateInviteRequest struct + Body struct{ ... } + Slug string + type CreateInviteResponse struct + Body *InviteResultResponse + type DeclineInviteRequest struct + Token string + type DeclineInviteResponse struct + Body *InviteResponse + type DefaultService struct + func (s *DefaultService) Accept(ctx context.Context, input AcceptInviteInput) (*Invite, error) + func (s *DefaultService) Create(ctx context.Context, input CreateInviteInput) (*InviteResult, error) + func (s *DefaultService) Decline(ctx context.Context, token string) (*Invite, error) + func (s *DefaultService) ExpireOld(ctx context.Context) (int, error) + func (s *DefaultService) GetByID(ctx context.Context, id uuid.UUID) (*Invite, error) + func (s *DefaultService) GetByToken(ctx context.Context, token string) (*Invite, error) + func (s *DefaultService) HasPendingInvite(ctx context.Context, organizationID uuid.UUID, email string) (bool, error) + func (s *DefaultService) List(ctx context.Context, input ListInvitesInput) ([]*Invite, error) + func (s *DefaultService) ListPendingForEmail(ctx context.Context, email string) ([]*Invite, error) + func (s *DefaultService) Resend(ctx context.Context, id uuid.UUID) (*InviteResult, error) + func (s *DefaultService) Revoke(ctx context.Context, id uuid.UUID) error + type GetInviteByTokenRequest struct + Token string + type GetInviteByTokenResponse struct + Body *InviteResponse + type Invite struct + AcceptedAt *time.Time + AcceptedByPrincipalID *uuid.UUID + CreatedAt time.Time + Email string + ExpiresAt time.Time + ID uuid.UUID + InviterPrincipalID uuid.UUID + LastSentAt time.Time + Message *string + OrganizationID uuid.UUID + ResendCount int + Role string + Status Status + Token string + UpdatedAt time.Time + func (i *Invite) CanAccept() bool + func (i *Invite) IsExpired() bool + func (i *Invite) IsPending() bool + type InviteResponse struct + AcceptedAt *time.Time + AcceptedByPrincipalID *string + CreatedAt time.Time + Email string + ExpiresAt time.Time + ID string + InviterPrincipalID string + LastSentAt time.Time + Message *string + OrganizationID string + ResendCount int + Role string + Status string + UpdatedAt time.Time + type InviteResult struct + Invite *Invite + InviteURL string + type InviteResultResponse struct + Invite *InviteResponse + InviteURL string + type ListInvitesInput struct + Email *string + Limit int + Offset int + OrganizationID *uuid.UUID + Status *Status + type ListInvitesRequest struct + Limit int + Offset int + Slug string + Status *string + type ListInvitesResponse struct + Body struct{ ... } + type ListPendingInvitesForEmailRequest struct + Email string + type ListPendingInvitesForEmailResponse struct + Body struct{ ... } + type ResendInviteRequest struct + InviteID string + Slug string + type ResendInviteResponse struct + Body *InviteResultResponse + type RevokeInviteRequest struct + InviteID string + Slug string + type Service interface + Accept func(ctx context.Context, input AcceptInviteInput) (*Invite, error) + Create func(ctx context.Context, input CreateInviteInput) (*InviteResult, error) + Decline func(ctx context.Context, token string) (*Invite, error) + ExpireOld func(ctx context.Context) (int, error) + GetByID func(ctx context.Context, id uuid.UUID) (*Invite, error) + GetByToken func(ctx context.Context, token string) (*Invite, error) + HasPendingInvite func(ctx context.Context, organizationID uuid.UUID, email string) (bool, error) + List func(ctx context.Context, input ListInvitesInput) ([]*Invite, error) + ListPendingForEmail func(ctx context.Context, email string) ([]*Invite, error) + Resend func(ctx context.Context, id uuid.UUID) (*InviteResult, error) + Revoke func(ctx context.Context, id uuid.UUID) error + func NewService(client *ent.Client, baseURL string) Service + type Status string + const StatusAccepted + const StatusDeclined + const StatusExpired + const StatusPending + const StatusRevoked