service

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExists   = fmt.Errorf("user already exists")
	ErrNotFound = fmt.Errorf("user not found")
)
View Source
var (
	ErrExceeded = fmt.Errorf("maximum number of users exceeded")
)

Functions

func Module

func Module(c *di.Container)

Types

type Service

type Service interface {
	CreateWithPassword(ctx context.Context, name, password, email string) (*users.User, error)
	GetByIDs(ctx context.Context, ids ...string) ([]*users.User, error)
	GetByID(_ context.Context, id string) (*users.User, error)
	GetByEmail(_ context.Context, email string) (*users.User, error)
	UsersCount(context.Context) (uint64, error)
	GetFirstUser(ctx context.Context) (*users.User, error)
}

type UserSerice

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

func New

func New(
	logger *zap.Logger,
	userRepo db_user.Repository,
	analyticsClient analytics.Client,
) *UserSerice

func (*UserSerice) CreateWithPassword

func (s *UserSerice) CreateWithPassword(ctx context.Context, name, password, email string) (*users.User, error)

func (*UserSerice) GetByEmail

func (s *UserSerice) GetByEmail(_ context.Context, email string) (*users.User, error)

func (*UserSerice) GetByID

func (s *UserSerice) GetByID(_ context.Context, id string) (*users.User, error)

func (*UserSerice) GetByIDs

func (s *UserSerice) GetByIDs(ctx context.Context, ids ...string) ([]*users.User, error)

func (*UserSerice) GetFirstUser

func (s *UserSerice) GetFirstUser(ctx context.Context) (*users.User, error)

func (*UserSerice) UsersCount

func (s *UserSerice) UsersCount(ctx context.Context) (uint64, error)

Jump to

Keyboard shortcuts

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