Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = xerror.NotFound(xerror.MemberInvitation) ErrAlreadyPending = xerror.AlreadyExists(xerror.MemberInvitation) ErrTokenConflict = xerror.AlreadyExists(xerror.MemberInvitation) )
Functions ¶
This section is empty.
Types ¶
type CreateParams ¶
type Invitation ¶
type Invitation struct {
Slug slug.Slug
OrganizationSlug slug.Slug
Email string
RoleSlug slug.Slug
Status model.MemberInvitationStatus
InvitedByUserSlug *slug.Slug
AcceptedUserSlug *slug.Slug
ExpiresAt time.Time
LastSentAt time.Time
AcceptedAt *time.Time
DeclinedAt *time.Time
RevokedAt *time.Time
ExpiredAt *time.Time
CreatedAt time.Time
UpdatedAt time.Time
}
type MarkAcceptedParams ¶
type MarkDeclinedParams ¶
type MarkExpiredParams ¶
type MarkRevokedParams ¶
type RefreshTokenParams ¶
type Repository ¶
type Repository interface {
Create(ctx context.Context, tx postgres.DBTX, params CreateParams) (*Invitation, error)
Find(ctx context.Context, tx postgres.DBTX, orgSlug, invitationSlug slug.Slug) (*Invitation, error)
FindByTokenHash(ctx context.Context, tx postgres.DBTX, tokenHash string) (*Invitation, error)
FindPendingByEmail(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, email string) (*Invitation, error)
ListByOrganization(
ctx context.Context,
tx postgres.DBTX,
orgSlug slug.Slug,
req model.ListRequest,
) ([]*Invitation, error)
ExpirePendingByOrganization(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, expiredAt time.Time) ([]*Invitation, error)
ListPendingByEmail(ctx context.Context, tx postgres.DBTX, email string, asOf time.Time) ([]*Invitation, error)
RefreshToken(ctx context.Context, tx postgres.DBTX, params RefreshTokenParams) (*Invitation, error)
MarkAccepted(ctx context.Context, tx postgres.DBTX, params MarkAcceptedParams) (*Invitation, error)
MarkDeclined(ctx context.Context, tx postgres.DBTX, params MarkDeclinedParams) (*Invitation, error)
MarkRevoked(ctx context.Context, tx postgres.DBTX, params MarkRevokedParams) (*Invitation, error)
MarkExpired(ctx context.Context, tx postgres.DBTX, params MarkExpiredParams) (*Invitation, error)
}
func NewRepository ¶
func NewRepository() Repository
Click to show internal directories.
Click to hide internal directories.