personlist

package
v0.0.0-...-80c91bd Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: Unlicense Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PersonList

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

func New

func New(log *slog.Logger, personProvider PersonProvider) *PersonList

func (*PersonList) AddPerson

func (pl *PersonList) AddPerson(ctx context.Context, person *models.Person) (id int64, err error)

func (*PersonList) EditPerson

func (pl *PersonList) EditPerson(ctx context.Context, person *models.Person) (err error)

func (*PersonList) GetList

func (pl *PersonList) GetList() (personList []models.Person, err error)

func (*PersonList) GetPerson

func (pl *PersonList) GetPerson(ctx context.Context, id int64) (person *models.Person, err error)

func (*PersonList) RemovePerson

func (pl *PersonList) RemovePerson(ctx context.Context, id int64) (err error)

type PersonProvider

type PersonProvider interface {
	AddPerson(ctx context.Context, person *models.Person) (int64, error)
	GetPerson(ctx context.Context, id int64) (*models.Person, error)
	EditPerson(ctx context.Context, person *models.Person) error
	RemovePerson(ctx context.Context, id int64) error
	GetList() ([]models.Person, error)
}

Jump to

Keyboard shortcuts

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