Documentation
¶
Index ¶
- func AcceptHandler(c echo.Context) error
- func AddRoutes(sg *echo.Group)
- func SendHandler(c echo.Context) error
- func SetService(svc Service)
- type DefaultInviteService
- func (d *DefaultInviteService) Accept(ctx context.ServiceContext, client *clients.GQLClient, id string) error
- func (*DefaultInviteService) Get(ctx context.ServiceContext, client *clients.GQLClient, id string) (*commons.Invite, error)
- func (*DefaultInviteService) Send(ctx context.ServiceContext, client *clients.GQLClient, ...) error
- func (*DefaultInviteService) Update(ctx context.ServiceContext, client *clients.GQLClient, id string, ...) error
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcceptHandler ¶
func SendHandler ¶
--- Flow --- 1. Fetch the organisation's symmetric key using the organisation ID. 2. Decrypt the organisation's symmetric key using user's received password. 3. Pull the public key of the invitee. 4. Create a new copy of the organisation's symmetric key encrypted with the invitee's public key. 5. Save the new encrypted copy in the database and send the invite.
func SetService ¶
func SetService(svc Service)
Types ¶
type DefaultInviteService ¶
type DefaultInviteService struct{}
func (*DefaultInviteService) Accept ¶
func (d *DefaultInviteService) Accept(ctx context.ServiceContext, client *clients.GQLClient, id string) error
--- Flow --- 1. Fetch the invite row from database using it's ID. 2. Copy the encrypted key copy from the invite row. 3. Insert new membership in the organisation for the invitee, their key copy and the assigned role from invite row. 4. Mark the invite accepted.
func (*DefaultInviteService) Get ¶
func (*DefaultInviteService) Get(ctx context.ServiceContext, client *clients.GQLClient, id string) (*commons.Invite, error)
func (*DefaultInviteService) Send ¶
func (*DefaultInviteService) Send(ctx context.ServiceContext, client *clients.GQLClient, options *commons.SendOptions) error
func (*DefaultInviteService) Update ¶
func (*DefaultInviteService) Update(ctx context.ServiceContext, client *clients.GQLClient, id string, options *commons.UpdateOptions) error
type Service ¶
type Service interface {
Get(context.ServiceContext, *clients.GQLClient, string) (*commons.Invite, error)
Send(context.ServiceContext, *clients.GQLClient, *commons.SendOptions) error
Accept(context.ServiceContext, *clients.GQLClient, string) error
Update(context.ServiceContext, *clients.GQLClient, string, *commons.UpdateOptions) error
}
func GetService ¶
func GetService() Service
Click to show internal directories.
Click to hide internal directories.