application

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoIdentity user is considered to be not logged in
	ErrNoIdentity = errors.New("no identity")
)

Functions

This section is empty.

Types

type Service

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

Service for customer management

func (*Service) GetForIdentity

func (s *Service) GetForIdentity(ctx context.Context, request *web.Request) (domain.Customer, error)

GetForIdentity returns the authenticated user if logged in

func (*Service) GetUserID

func (s *Service) GetUserID(ctx context.Context, request *web.Request) (string, error)

GetUserID returns the current user ID if logged in

Can be used to check if user is logged in. Returns ErrNoIdentity if user is considered to be not logged in.

func (*Service) Inject

func (s *Service) Inject(
	webIdentityService *auth.WebIdentityService,
	customerIdentityService domain.CustomerIdentityService,
) *Service

Inject dependencies

Jump to

Keyboard shortcuts

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