domain

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: May 31, 2025 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAppNotFound       = errors.New("not found")
	ErrAppNotImplemented = errors.New("not implemented")
)

Functions

This section is empty.

Types

type User

type User struct {
	ID           int       `json:"id" xml:"id"`
	BirthDate    time.Time `json:"birth_date" xml:"birth_date"`
	Name         string    `json:"name" xml:"name"`
	EmailAddress string    `json:"email_address" xml:"email_address"`
}

type UserProvider added in v0.9.0

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

func NewUserProvider added in v0.9.0

func NewUserProvider(repo UserRepo) (*UserProvider, error)

func (*UserProvider) Create added in v0.9.0

func (up *UserProvider) Create(ctx context.Context, u User) (User, error)

func (*UserProvider) Delete added in v0.9.0

func (up *UserProvider) Delete(ctx context.Context, id string) error

func (*UserProvider) Get added in v0.9.0

func (up *UserProvider) Get(ctx context.Context, id string) (User, error)

func (UserProvider) List added in v0.9.0

func (up UserProvider) List(ctx context.Context, offset, limit int) ([]User, error)

func (*UserProvider) Update added in v0.9.0

func (up *UserProvider) Update(ctx context.Context, u User) error

type UserRepo

type UserRepo interface {
	CreateUser(ctx context.Context, u User) (User, error)
	FindUserByID(ctx context.Context, id int) (User, error)
	FindUserByName(ctx context.Context, name string) (User, error)
	DeleteUser(ctx context.Context, id int) error
	UpdateUser(ctx context.Context, u User) error
	ListUsers(ctx context.Context, offset, limit int) ([]User, error)
}

Jump to

Keyboard shortcuts

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