service

package
v0.0.0-...-7dbc1ad Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRepository = errors.New("Unable to handle Database Request")

Functions

This section is empty.

Types

type Middleware

type Middleware func(Service) Service

Middleware describes a service (as opposed to endpoint) middleware.

func InstrumentingMiddleware

func InstrumentingMiddleware(accounts metrics.Counter) Middleware

InstrumentingMiddleware returns a service middleware that instruments the number of integers summed and characters concatenated over the lifetime of the service.

func LoggingMiddleware

func LoggingMiddleware(logger log.Logger) Middleware

LoggingMiddleware takes a logger as a dependency and returns a service Middleware.

type Repository

type Repository interface {
	CreateUser(ctx context.Context, user model.User) error
	DeleteUser(ctx context.Context, ID uuid.UUID) error
	AuthenticateUser(ctx context.Context, email string, password string) (bool, error)
}

func NewRepository

func NewRepository(db *gorm.DB, logger log.Logger) Repository

type Service

type Service interface {
	CreateUser(ctx context.Context, email string, password string) (string, error)
}

func New

func New(repository Repository, logger log.Logger, accounts metrics.Counter) Service

Jump to

Keyboard shortcuts

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