service

package
v0.0.0-...-49f637e Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLimitOutOfRange  = errors.New("`limit` must be a positive integer")
	ErrOffsetOutOfRange = errors.New("`offset` must be an integer greater than -1")
	ErrIDOutOfRange     = errors.New("`id` must be a positive integer")
)

Functions

func NewUserService

func NewUserService(repository repository.UserRepository) *userService

Types

type LoggingMiddleware

type LoggingMiddleware func(UserService) UserService

func NewLoggingMiddleware

func NewLoggingMiddleware(logger log.Logger) LoggingMiddleware

type MetricsMiddleware

type MetricsMiddleware func(UserService) UserService

func NewInstrumentationMiddleware

func NewInstrumentationMiddleware(count prometheus.CounterVec, latency prometheus.HistogramVec) MetricsMiddleware

type PublisherService

type PublisherService interface {
	Publish(context.Context, *entity.Message) error
}

func NewNSQPublisher

func NewNSQPublisher(client *nsq.Producer) PublisherService

type UserService

type UserService interface {
	GetUsers(context.Context, *entity.Pagination) ([]*entity.User, error)
	GetUserById(context.Context, int) (*entity.User, error)
	CreateUser(context.Context, *entity.User) (*entity.User, error)
	DeleteUser(context.Context, int) (*entity.User, error)
}

Jump to

Keyboard shortcuts

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