user

package
v0.0.0-...-5e7ffb8 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRepo = errors.New("unable to handle repository request")
)

Functions

This section is empty.

Types

type RepositoryInterface

type RepositoryInterface interface {
	Store(user *User) (*User, error)
	GetByID(id string) (*User, error)
	Update(user *User) (*User, error)
	Delete(id string) error
	GetAll() ([]User, error)
}

type Service

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

func NewService

func NewService(repository RepositoryInterface, logger log.Logger) *Service

func (Service) CreateUser

func (s Service) CreateUser(_ context.Context, user *User) (*User, error)

func (Service) DeleteUser

func (s Service) DeleteUser(_ context.Context, id string) error

func (Service) GetUser

func (s Service) GetUser(_ context.Context, id string) (*User, error)

func (Service) ListUsers

func (s Service) ListUsers(_ context.Context) ([]User, error)

func (Service) UpdateUser

func (s Service) UpdateUser(_ context.Context, user *User) (*User, error)

type ServiceInterface

type ServiceInterface interface {
	CreateUser(ctx context.Context, user *User) (*User, error)
	GetUser(ctx context.Context, id string) (*User, error)
	UpdateUser(ctx context.Context, user *User) (*User, error)
	DeleteUser(ctx context.Context, id string) error
	ListUsers(ctx context.Context) ([]User, error)
}

type User

type User struct {
	ID          uuid.UUID
	Email       string
	Password    string
	CreatedAt   time.Time
	UpdatedAt   time.Time
	DeletedAt   *time.Time
	ActivatedAt *time.Time
}

Jump to

Keyboard shortcuts

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