invites

package
v1.1.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

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 CreateOptions struct {
	OrgID         string `json:"org_id,omitempty"`
	Scope         string `json:"scope,omitempty"`
	ReceiverEmail string `json:"receiver_email,omitempty"`
}

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) 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 InsertOptions struct {
	UserID string `json:"user_id,omitempty"`
	OrgID  string `json:"org_id,omitempty"`
	Key    string `json:"key,omitempty"`
	Email  string `json:"email,omitempty"`
	RoleID string `json:"role_id,omitempty"`
}

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 SendOptions struct {
	OrgID     string
	RoleID    string
	InviterID string

	//	Decrypted organisation key.
	Key          []byte
	InviteeEmail string
}

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL