service

package
v0.0.0-...-2d73068 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package service provides the code which encapsulates business logic for managing users and identities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetExpiryDate

func GetExpiryDate(config UserServiceConfiguration, now func() time.Time) string

GetExpiryDate a utility function which returns the expiry date, ie, when the user deactivation will happen The date is based on the given 'now', and takes into account the delay for which the user is given a chance to come back (7 days by default)

func NewTenantService

func NewTenantService(config tenantConfig) service.TenantService

NewTenantService creates a new tenant service

func NewUserService

NewUserService creates a new service to manage users

Types

type EmailVerificationClient

type EmailVerificationClient struct {
	// contains filtered or unexported fields
}

func NewEmailVerificationClient

func NewEmailVerificationClient(app application.Application) *EmailVerificationClient

NewEmailVerificationClient creates a new client for managing email verification.

func (*EmailVerificationClient) SendVerificationCode

func (c *EmailVerificationClient) SendVerificationCode(ctx context.Context, req *goa.RequestData, identity repository.Identity) (*repository.VerificationCode, error)

SendVerificationCode generates and sends out an email with verification code.

func (*EmailVerificationClient) VerifyCode

VerifyCode validates whether the code is present in our database and returns a non-nil if yes.

type EmailVerificationService

type EmailVerificationService interface {
	SendVerificationCode(ctx context.Context, req *goa.RequestData, identity repository.Identity) (*repository.VerificationCode, error)
	VerifyCode(ctx context.Context, code string) (*repository.VerificationCode, error)
}

type UserServiceConfiguration

type UserServiceConfiguration interface {
	GetUserDeactivationFetchLimit() int
	GetUserDeactivationInactivityNotificationPeriod() time.Duration
	GetUserDeactivationInactivityPeriod() time.Duration
	GetUserDeactivationRescheduleDelay() time.Duration
	GetUserDeactivationWhiteList() []string
}

UserServiceConfiguration the configuration for the User service

Jump to

Keyboard shortcuts

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