Documentation ¶
Index ¶
- Constants
- type InvitationManager
- func (o *InvitationManager) CountByOrganization(globalid string) (int, error)
- func (o *InvitationManager) Get(username string, organization string, role string, status InvitationStatus) (*JoinOrganizationInvitation, error)
- func (o *InvitationManager) GetByUser(username string) ([]JoinOrganizationInvitation, error)
- func (o *InvitationManager) GetPendingByOrganization(globalid string) ([]JoinOrganizationInvitation, error)
- func (o *InvitationManager) HasInvite(globalid string, username string) (hasInvite bool, err error)
- func (o *InvitationManager) RemoveAll(globalid string) error
- func (o *InvitationManager) Save(invite *JoinOrganizationInvitation) error
- type InvitationStatus
- type JoinOrganizationInvitation
Constants ¶
View Source
const ( RoleMember = "member" RoleOwner = "owner" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InvitationManager ¶
type InvitationManager struct {
// contains filtered or unexported fields
}
InvitationManager is used to store organizations
func NewInvitationManager ¶
func NewInvitationManager(r *http.Request) *InvitationManager
NewInvitationManager creates and initializes a new InvitationManager
func (*InvitationManager) CountByOrganization ¶
func (o *InvitationManager) CountByOrganization(globalid string) (int, error)
CountByOrganization Counts the amount of invitations, filtered by an organization
func (*InvitationManager) Get ¶
func (o *InvitationManager) Get(username string, organization string, role string, status InvitationStatus) (*JoinOrganizationInvitation, error)
Get get an invitation by it's content, not really this usefull, TODO: just make an exists method
func (*InvitationManager) GetByUser ¶
func (o *InvitationManager) GetByUser(username string) ([]JoinOrganizationInvitation, error)
GetByUser gets all invitations for a user.
func (*InvitationManager) GetPendingByOrganization ¶
func (o *InvitationManager) GetPendingByOrganization(globalid string) ([]JoinOrganizationInvitation, error)
GetPendingByOrganization gets all pending invitations for a user.
func (*InvitationManager) HasInvite ¶
func (o *InvitationManager) HasInvite(globalid string, username string) (hasInvite bool, err error)
HasInvite Checks if a user has an invite for an organization
func (*InvitationManager) RemoveAll ¶
func (o *InvitationManager) RemoveAll(globalid string) error
RemoveAll Removes all invitations linked to an organization
func (*InvitationManager) Save ¶
func (o *InvitationManager) Save(invite *JoinOrganizationInvitation) error
Save save/update an invitation
type InvitationStatus ¶
type InvitationStatus string
const ( RequestPending InvitationStatus = "pending" RequestAccepted InvitationStatus = "accepted" RequestRejected InvitationStatus = "rejected" )
type JoinOrganizationInvitation ¶
type JoinOrganizationInvitation struct { ID bson.ObjectId `json:"-" bson:"_id,omitempty"` Organization string `json:"organization"` Role string `json:"role"` User string `json:"user"` Status InvitationStatus `json:"status"` Created db.DateTime `json:"created"` }
JoinOrganizationInvitation defines an invitation to join an organization
Click to show internal directories.
Click to hide internal directories.