domain

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 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 SQLUserProvider

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

func NewSQLUserProvider

func NewSQLUserProvider(repo UserRepo) (*SQLUserProvider, error)

func (*SQLUserProvider) Create

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

func (*SQLUserProvider) Delete

func (up *SQLUserProvider) Delete(ctx context.Context, idString string) error

func (*SQLUserProvider) Get

func (up *SQLUserProvider) Get(ctx context.Context, ent string) (User, error)

func (SQLUserProvider) List

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

func (*SQLUserProvider) Update

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

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 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