Documentation ¶
Index ¶
- func SetService(svc Service)
- type CreateOptions
- type CreateResponse
- type DefaultService
- func (d *DefaultService) Accept(ctx context.ServiceContext, client *clients.GQLClient, id string) error
- func (*DefaultService) Get(ctx context.ServiceContext, client *clients.GQLClient, id string) (*Invite, error)
- func (*DefaultService) Send(ctx context.ServiceContext, client *clients.GQLClient, options *SendOptions) error
- func (*DefaultService) Update(ctx context.ServiceContext, client *clients.GQLClient, id string, ...) error
- type InsertOptions
- type Invite
- type ListOptions
- type SendOptions
- type Service
- type SetUpdateOptions
- type UpdateOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetService ¶
func SetService(svc Service)
Types ¶
type CreateOptions ¶ added in v1.1.7
type CreateResponse ¶ added in v1.1.7
type CreateResponse struct {
ID string `json:"id,omitempty"`
}
type DefaultService ¶ added in v1.1.7
type DefaultService struct{}
func (*DefaultService) Accept ¶ added in v1.1.7
func (d *DefaultService) 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 (*DefaultService) Get ¶ added in v1.1.7
func (*DefaultService) Get(ctx context.ServiceContext, client *clients.GQLClient, id string) (*Invite, error)
func (*DefaultService) Send ¶ added in v1.1.7
func (*DefaultService) Send(ctx context.ServiceContext, client *clients.GQLClient, options *SendOptions) error
func (*DefaultService) Update ¶ added in v1.1.7
func (*DefaultService) Update(ctx context.ServiceContext, client *clients.GQLClient, id string, options *UpdateOptions) error
type InsertOptions ¶ added in v1.1.7
type Invite ¶ added in v1.1.7
type Invite struct { ID string `json:"id,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` UserID string `json:"user_id,omitempty"` OrgID string `json:"org_id,omitempty"` Organisation organisations.Organisation `json:"organisation,omitempty"` Key string `json:"key,omitempty"` Email string `json:"email,omitempty"` RoleID string `json:"role_id,omitempty"` Accepted bool `json:"accepted,omitempty"` }
type ListOptions ¶ added in v1.1.7
type ListOptions struct { // OrgID string `json:"org_id,omitempty"` Accepted bool `json:"accepted,omitempty"` }
type SendOptions ¶ added in v1.1.7
type Service ¶
type Service interface { Get(context.ServiceContext, *clients.GQLClient, string) (*Invite, error) Send(context.ServiceContext, *clients.GQLClient, *SendOptions) error Accept(context.ServiceContext, *clients.GQLClient, string) error Update(context.ServiceContext, *clients.GQLClient, string, *UpdateOptions) error }
func GetService ¶
func GetService() Service
type SetUpdateOptions ¶ added in v1.1.7
type SetUpdateOptions struct {
Accepted bool `json:"accepted,omitempty"`
}
type UpdateOptions ¶ added in v1.1.7
type UpdateOptions struct {
Set SetUpdateOptions
}
Click to show internal directories.
Click to hide internal directories.