invites

package
v0.0.70 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package invites provides the invite utilities for minder

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCode

func GenerateCode() string

GenerateCode generates a random invite code

func GetExpireIn7Days

func GetExpireIn7Days(t time.Time) *timestamppb.Timestamp

GetExpireIn7Days returns the expiration date of the invitation 7 days from t.Now()

func IsExpired

func IsExpired(t time.Time) bool

IsExpired checks if the invitation has expired

Types

type InviteService

type InviteService interface {
	// CreateInvite creates a new user invite
	CreateInvite(ctx context.Context, qtx db.Querier, idClient auth.Resolver, eventsPub events.Publisher,
		emailConfig serverconfig.EmailConfig, targetProject uuid.UUID, authzRole authz.Role, inviteeEmail string,
	) (*minder.Invitation, error)

	// UpdateInvite updates the invite status
	UpdateInvite(ctx context.Context, qtx db.Querier, idClient auth.Resolver, eventsPub events.Publisher,
		emailConfig serverconfig.EmailConfig, targetProject uuid.UUID, authzRole authz.Role, inviteeEmail string,
	) (*minder.Invitation, error)

	// RemoveInvite removes the user invite
	RemoveInvite(ctx context.Context, qtx db.Querier, idClient auth.Resolver, targetProject uuid.UUID,
		authzRole authz.Role, inviteeEmail string,
	) (*minder.Invitation, error)
}

InviteService encapsulates the methods to manage user invites to a project

func NewInviteService

func NewInviteService() InviteService

NewInviteService creates a new instance of InviteService

Directories

Path Synopsis
Package mock_invites is a generated GoMock package.
Package mock_invites is a generated GoMock package.

Jump to

Keyboard shortcuts

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