vaultservice

package
v0.0.0-...-01ba355 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

type Middleware func(Service) Service

Middleware represents a service middleware.

func InstrumentingMiddleware

func InstrumentingMiddleware(ints metrics.Counter) Middleware

InstrumentingMiddleware returns a service middleware that instruments the number of HTTP requests of the service.

func LoggingMiddleware

func LoggingMiddleware(logger log.Logger) Middleware

LoggingMiddleware takes a logger as a dependency and returns a ServiceMiddleware.

type Service

type Service interface {
	Hash(ctx context.Context, password string) (string, error)
	Validate(ctx context.Context, password, hash string) (bool, error)
}

Service describes a service that hashes and validates passwords.

func New

func New(logger log.Logger, ints metrics.Counter, s store.Store) Service

New makes a new service.

Jump to

Keyboard shortcuts

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