Documentation
¶
Overview ¶
Package invites provides the invite utilities for minder
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetExpireIn7Days ¶
func GetExpireIn7Days(t time.Time) *timestamppb.Timestamp
GetExpireIn7Days returns the expiration date of the invitation 7 days from t.Now()
Types ¶
type InviteService ¶
type InviteService interface {
// CreateInvite creates a new user invite
CreateInvite(ctx context.Context, qtx db.Querier, eventsPub interfaces.Publisher,
emailConfig serverconfig.EmailConfig, targetProject uuid.UUID, authzRole authz.Role, inviteeEmail string,
) (*minder.Invitation, error)
// UpdateInvite updates the invite status
UpdateInvite(ctx context.Context, qtx db.Querier, eventsPub interfaces.Publisher,
emailConfig serverconfig.EmailConfig, targetProject uuid.UUID, authzRole authz.Role, inviteeEmail string,
) (*minder.Invitation, error)
// RemoveInvite removes the user invite
RemoveInvite(ctx context.Context, qtx db.Querier, code string,
) error
// GetInvitesForSelf gets all invites for the current user (from context)
GetInvitesForSelf(ctx context.Context, qtx db.Querier, idClient auth.Resolver) ([]*minder.Invitation, error)
// GetInvite returns an invite by its code, or an error if none is found.
GetInvite(ctx context.Context, qtx db.Querier, code string) (*minder.Invitation, error)
// GetInviteForEmail returns an invite for a given email and project.
GetInvitesForEmail(ctx context.Context, qtx db.Querier, targetProject uuid.UUID,
inviteeEmail string,
) ([]*minder.Invitation, error)
// ListInvitationsForProject lists all invitations for a project (admin view, no codes)
ListInvitationsForProject(ctx context.Context, qtx db.Querier, targetProject uuid.UUID) ([]*minder.Invitation, error)
}
InviteService encapsulates the methods to manage user invites to a project
func NewInviteService ¶
func NewInviteService() InviteService
NewInviteService creates a new instance of InviteService
Directories
¶
| Path | Synopsis |
|---|---|
|
Package test provides a fake implementation of InviteService for testing Initially generated by Claude Sonnet 4.5 with the following prompt: > Generate a fake for the `InviteService` in the directory `internal/invites/fake`.
|
Package test provides a fake implementation of InviteService for testing Initially generated by Claude Sonnet 4.5 with the following prompt: > Generate a fake for the `InviteService` in the directory `internal/invites/fake`. |
Click to show internal directories.
Click to hide internal directories.