Documentation ¶
Index ¶
- type GormInvitationRepository
- func (m *GormInvitationRepository) AddRole(ctx context.Context, invitationId uuid.UUID, roleId uuid.UUID) error
- func (m *GormInvitationRepository) CheckExists(ctx context.Context, id uuid.UUID) (bool, error)
- func (m *GormInvitationRepository) Create(ctx context.Context, i *Invitation) error
- func (m *GormInvitationRepository) Delete(ctx context.Context, id uuid.UUID) error
- func (m *GormInvitationRepository) FindByAcceptCode(ctx context.Context, acceptCode uuid.UUID) (*Invitation, error)
- func (m *GormInvitationRepository) ListForIdentity(ctx context.Context, inviteToID uuid.UUID) ([]Invitation, error)
- func (m *GormInvitationRepository) ListForResource(ctx context.Context, resourceID string) ([]Invitation, error)
- func (m *GormInvitationRepository) ListRoles(ctx context.Context, id uuid.UUID) ([]rolerepo.Role, error)
- func (m *GormInvitationRepository) Load(ctx context.Context, id uuid.UUID) (*Invitation, error)
- func (m *GormInvitationRepository) Save(ctx context.Context, i *Invitation) error
- func (m *GormInvitationRepository) TableName() string
- type Invitation
- type InvitationRepository
- type InvitationRole
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GormInvitationRepository ¶
type GormInvitationRepository struct {
// contains filtered or unexported fields
}
GormInvitationRepository is the implementation of the storage interface for Invitation.
func (*GormInvitationRepository) AddRole ¶
func (m *GormInvitationRepository) AddRole(ctx context.Context, invitationId uuid.UUID, roleId uuid.UUID) error
func (*GormInvitationRepository) CheckExists ¶
func (m *GormInvitationRepository) CheckExists(ctx context.Context, id uuid.UUID) (bool, error)
func (*GormInvitationRepository) Create ¶
func (m *GormInvitationRepository) Create(ctx context.Context, i *Invitation) error
func (*GormInvitationRepository) Delete ¶
func (m *GormInvitationRepository) Delete(ctx context.Context, id uuid.UUID) error
func (*GormInvitationRepository) FindByAcceptCode ¶
func (m *GormInvitationRepository) FindByAcceptCode(ctx context.Context, acceptCode uuid.UUID) (*Invitation, error)
FindByAcceptCode returns the Invitation record for the specified accept code
func (*GormInvitationRepository) ListForIdentity ¶
func (m *GormInvitationRepository) ListForIdentity(ctx context.Context, inviteToID uuid.UUID) ([]Invitation, error)
func (*GormInvitationRepository) ListForResource ¶
func (m *GormInvitationRepository) ListForResource(ctx context.Context, resourceID string) ([]Invitation, error)
func (*GormInvitationRepository) Load ¶
func (m *GormInvitationRepository) Load(ctx context.Context, id uuid.UUID) (*Invitation, error)
func (*GormInvitationRepository) Save ¶
func (m *GormInvitationRepository) Save(ctx context.Context, i *Invitation) error
func (*GormInvitationRepository) TableName ¶
func (m *GormInvitationRepository) TableName() string
type Invitation ¶
type Invitation struct { gormsupport.Lifecycle // This is the primary key value InvitationID uuid.UUID `sql:"type:uuid default uuid_generate_v4()" gorm:"primary_key;column:invitation_id"` // The identity ID (organization, team or security group) to which the user is being invited to InviteTo *uuid.UUID `sql:"type:uuid" gorm:"column:invite_to"` // or, the Resource ID to which the user is being invited to accept a role ResourceID *string `sql:"type:string" gorm:"column:resource_id"` Identity account.Identity `gorm:"ForeignKey:IdentityID;AssociationForeignKey:ID"` IdentityID uuid.UUID // AcceptCode is the code sent in the invitation e-mail to the user, used to accept the invitation AcceptCode uuid.UUID `sql:"type:uuid" gorm:"column:accept_code"` Member bool // url's to redirect after accepting invitation in case of success or failure SuccessRedirectURL string `sql:"type:string" gorm:"column:success_redirect_url"` FailureRedirectURL string `sql:"type:string" gorm:"column:failure_redirect_url"` }
func (Invitation) GetLastModified ¶
func (m Invitation) GetLastModified() time.Time
GetLastModified returns the last modification time
func (Invitation) TableName ¶
func (m Invitation) TableName() string
type InvitationRepository ¶
type InvitationRepository interface { CheckExists(ctx context.Context, id uuid.UUID) (bool, error) Load(ctx context.Context, id uuid.UUID) (*Invitation, error) Create(ctx context.Context, i *Invitation) error Save(ctx context.Context, i *Invitation) error ListForIdentity(ctx context.Context, inviteToID uuid.UUID) ([]Invitation, error) ListForResource(ctx context.Context, resourceID string) ([]Invitation, error) Delete(ctx context.Context, id uuid.UUID) error ListRoles(ctx context.Context, id uuid.UUID) ([]rolerepo.Role, error) AddRole(ctx context.Context, invitationId uuid.UUID, roleId uuid.UUID) error FindByAcceptCode(ctx context.Context, acceptCode uuid.UUID) (*Invitation, error) }
InvitationRepository represents the storage interface.
func NewInvitationRepository ¶
func NewInvitationRepository(db *gorm.DB) InvitationRepository
NewInvitationRepository creates a new storage type.
type InvitationRole ¶
type InvitationRole struct { InvitationID uuid.UUID `sql:"type:uuid" gorm:"primary_key;column:invitation_id"` Role rolerepo.Role `gorm:"ForeignKey:RoleID;AssociationForeignKey:RoleID"` RoleID uuid.UUID `sql:"type:uuid" gorm:"primary_key;column:role_id"` }
InvitationRole represents the storage interface for storing an invitation's roles
func (InvitationRole) TableName ¶
func (ir InvitationRole) TableName() string
Click to show internal directories.
Click to hide internal directories.