rest

package
v0.0.0-...-ef67ded Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrPersonDataNotFound

type ErrPersonDataNotFound interface {
	Error() string
	ImplementsPersonDataNotFoundError()
}

type Service

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

func (*Service) Shutdown

func (s *Service) Shutdown() <-chan struct{}

func (*Service) Start

func (s *Service) Start(storage Storage, stats StatisticsProvider)

func (*Service) Stop

func (s *Service) Stop(ctx context.Context) (err error)

type StatisticsProvider

type StatisticsProvider interface {
	AgeByName(name string) (age int, err error)
	GenderByName(name string) (gender string, err error)
	CountryByName(name string) (country string, err error)
}

type Storage

type Storage interface {
	CreateNewPersonDataV1(ctx context.Context, data *models.EnrichedPersonDataV1) error
	SearchResultV1(ctx context.Context, filters *models.SearchFilters) (result *models.SearchResultV1, err error)
	EnrichedPersonDataV1(ctx context.Context, id int64) (*models.EnrichedPersonDataV1, error)
	UpdatePersonDataV1(ctx context.Context, id int64, data *models.EditedPersonDataV1) error
	DeletePersonData(ctx context.Context, id int64) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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